diff --git a/tezt/tests/dac.ml b/tezt/tests/dac.ml index 22b288d12f31af736e806a3d99a26bf2e5265dd3..9189ef4f950d3d912b98d9d4fa829ddbe8792587 100644 --- a/tezt/tests/dac.ml +++ b/tezt/tests/dac.ml @@ -342,63 +342,6 @@ module Legacy = struct in return @@ check_valid_root_hash expected_rh actual_rh - let test_dac_node_imports_committee_members = - Protocol.register_test - ~__FILE__ - ~title:"dac node imports dac members sk_uris" - ~tags:["dac"; "dac_node"] - ~supports:Protocol.(From_protocol (Protocol.number Alpha)) - @@ fun protocol -> - let* node, client = Client.init_with_protocol `Client ~protocol () in - let run_dac = Dac_node.run ~wait_ready:true in - let* committee_member = - Client.bls_gen_keys ~alias:"committee_member" client - in - let* committee_member_info = - Client.bls_show_address ~alias:committee_member client - in - let committee_member_address = - committee_member_info.aggregate_public_key_hash - in - let dac_node = - Dac_node.create_legacy - ~node - ~client - ~threshold:1 - ~committee_members:[committee_member_address] - () - in - let* _dir = Dac_node.init_config dac_node in - let ready_promise = - Dac_node.wait_for dac_node "committee_keys_imported.v0" (fun _ -> Some ()) - in - let* () = run_dac dac_node in - let* () = ready_promise in - let* () = check_liveness_and_readiness dac_node in - let* () = Dac_node.terminate dac_node in - unit - - let test_dac_node_dac_threshold_not_reached = - Protocol.register_test - ~__FILE__ - ~title:"dac node displays warning if dac threshold is not reached" - ~tags:["dac"; "dac_node"] - ~supports:Protocol.(From_protocol (Protocol.number Alpha)) - @@ fun protocol -> - let* node, client = Client.init_with_protocol `Client ~protocol () in - let dac_node = - Dac_node.create_legacy ~node ~client ~threshold:1 ~committee_members:[] () - in - let* _dir = Dac_node.init_config dac_node in - let run_dac = Dac_node.run ~wait_ready:false in - let error_promise = - Dac_node.wait_for dac_node "dac_threshold_not_reached.v0" (fun _ -> - Some ()) - in - let* () = run_dac dac_node in - let* () = error_promise in - Dac_node.terminate dac_node - let test_dac_not_ready_without_protocol = Protocol.register_test ~__FILE__ @@ -427,177 +370,6 @@ module Legacy = struct let* () = Dac_node.terminate dac_node in return () - let test_dac_node_handles_dac_store_preimage_merkle_V0 _protocol dac_node - sc_rollup_node _sc_rollup_address _node _client pvm_name _threshold - _committee_members = - let payload = "test" in - let* actual_rh, l1_operation = - Dac_helper.Call_endpoint.V0.post_store_preimage - dac_node - ~payload - ~pagination_scheme:"Merkle_tree_V0" - in - (* Expected reveal hash equals to the result of - [Tezos_dac_alpha.Dac_pages_encoding.Merkle_tree.V0.serialize_payload "test"]. - *) - let expected_rh = - "00a3703854279d2f377d689163d1ec911a840d84b56c4c6f6cafdf0610394df7c6" - in - check_valid_root_hash expected_rh actual_rh ; - let filename = - Filename.concat - (Filename.concat (Sc_rollup_node.data_dir sc_rollup_node) pvm_name) - actual_rh - in - let cin = open_in filename in - let recovered_payload = really_input_string cin (in_channel_length cin) in - let () = close_in cin in - (* Discard first five preamble bytes *) - let recovered_preimage = - String.sub recovered_payload 5 (String.length recovered_payload - 5) - in - check_preimage payload recovered_preimage ; - let* is_signature_valid = - Dac_helper.Call_endpoint.V0.get_verify_signature dac_node l1_operation - in - Check.( - (is_signature_valid = true) - bool - ~error_msg:"Signature of external message is not valid") ; - unit - - let test_dac_node_handles_dac_store_preimage_hash_chain_V0 _protocol dac_node - sc_rollup_node _sc_rollup_address _node _client pvm_name _threshold - _committee_members = - let payload = "test" in - let* actual_rh, _l1_operation = - Dac_helper.Call_endpoint.V0.post_store_preimage - dac_node - ~payload - ~pagination_scheme:"Hash_chain_V0" - in - (* Expected reveal hash equals to the result of - [Tezos_dac_alpha.Dac_pages_encoding.Hash_chain.V0.serialize_payload "test"]. - *) - let expected_rh = - "00928b20366943e2afd11ebc0eae2e53a93bf177a4fcf35bcc64d503704e65e202" - in - check_valid_root_hash expected_rh actual_rh ; - let filename = - Filename.concat - (Filename.concat (Sc_rollup_node.data_dir sc_rollup_node) pvm_name) - actual_rh - in - let cin = open_in filename in - let recovered_payload = really_input_string cin (in_channel_length cin) in - let () = close_in cin in - let recovered_preimage = - String.sub recovered_payload 0 (String.length payload) - in - check_preimage payload recovered_preimage ; - unit - - let test_dac_node_handles_dac_retrieve_preimage_merkle_V0 _protocol dac_node - sc_rollup_node _sc_rollup_address _node _client pvm_name _threshold - _committee_members = - let payload = "test" in - let* actual_rh, _l1_operation = - Dac_helper.Call_endpoint.V0.post_store_preimage - dac_node - ~payload - ~pagination_scheme:"Merkle_tree_V0" - in - (* Expected reveal hash equals to the result of - [Tezos_dac_alpha.Dac_pages_encoding.Merkle_tree.V0.serialize_payload "test"]. - *) - let expected_rh = - "00a3703854279d2f377d689163d1ec911a840d84b56c4c6f6cafdf0610394df7c6" - in - check_valid_root_hash expected_rh actual_rh ; - let filename = - Filename.concat - (Filename.concat (Sc_rollup_node.data_dir sc_rollup_node) pvm_name) - actual_rh - in - let cin = open_in filename in - let recovered_payload = really_input_string cin (in_channel_length cin) in - let () = close_in cin in - let recovered_preimage = Hex.of_string recovered_payload in - let* preimage = - Dac_helper.Call_endpoint.V0.get_preimage dac_node expected_rh - in - Check.( - (preimage = Hex.show recovered_preimage) - string - ~error_msg: - "Returned page does not match the expected one (Current: %L <> \ - Expected: %R)") ; - unit - - let test_rollup_arith_uses_reveals protocol dac_node sc_rollup_node - sc_rollup_address _node client _pvm_name _threshold _committee_members = - let* genesis_info = - RPC.Client.call ~hooks client - @@ RPC.get_chain_block_context_smart_rollups_smart_rollup_genesis_info - sc_rollup_address - in - let init_level = JSON.(genesis_info |-> "level" |> as_int) in - let* () = Sc_rollup_node.run sc_rollup_node sc_rollup_address [] in - let* level = - Sc_rollup_node.wait_for_level ~timeout:120. sc_rollup_node init_level - in - let nadd = 32 * 1024 in - let payload = - let rec aux b n = - if n > 0 then ( - Buffer.add_string b "1 +" ; - (aux [@tailcall]) b (n - 1)) - else ( - Buffer.add_string b "value" ; - String.of_bytes (Buffer.to_bytes b)) - in - let buf = Buffer.create ((nadd * 3) + 2) in - Buffer.add_string buf "0 " ; - aux buf nadd - in - let* actual_rh, _l1_operation = - Dac_helper.Call_endpoint.V0.post_store_preimage - dac_node - ~payload - ~pagination_scheme:"Hash_chain_V0" - in - let expected_rh = - "0027782d2a7020be332cc42c4e66592ec50305f559a4011981f1d5af81428e7aa3" - in - check_valid_root_hash expected_rh actual_rh ; - let* () = - send_messages - client - ["hash:" ^ actual_rh] - ~alter_final_msg:(fun s -> "text:" ^ s) - in - let* () = bake_levels 2 client in - let* _ = - Sc_rollup_node.wait_for_level ~timeout:120. sc_rollup_node (level + 2) - in - let sc_rollup_client = Sc_rollup_client.create ~protocol sc_rollup_node in - let*! encoded_value = - Sc_rollup_client.state_value ~hooks sc_rollup_client ~key:"vars/value" - in - let value = - match Data_encoding.(Binary.of_bytes int31) @@ encoded_value with - | Error error -> - failwith - (Format.asprintf - "The arithmetic PVM has an unexpected state: %a" - Data_encoding.Binary.pp_read_error - error) - | Ok x -> x - in - Check.( - (value = nadd) int ~error_msg:"Invalid value in rollup state (%L <> %R)") ; - unit - (* The following tests involve multiple legacy DAC nodes running at the same time and playing either the coordinator, committee member or observer role. *) @@ -3013,45 +2785,6 @@ module Api_regression = struct end let register ~protocols = - (* Tests with layer1 and dac nodes *) - Legacy.test_dac_node_imports_committee_members protocols ; - Legacy.test_dac_node_dac_threshold_not_reached protocols ; - scenario_with_layer1_legacy_and_rollup_nodes - ~hooks - ~__FILE__ - ~tags:["dac"; "dac_node"] - "dac_reveals_data_merkle_tree_v0" - Legacy.test_dac_node_handles_dac_store_preimage_merkle_V0 - protocols - ~threshold:1 - ~committee_size:1 ; - scenario_with_layer1_legacy_and_rollup_nodes - ~hooks - ~__FILE__ - ~tags:["dac"; "dac_node"] - "dac_reveals_data_hash_chain_v0" - Legacy.test_dac_node_handles_dac_store_preimage_hash_chain_V0 - protocols - ~threshold:1 - ~committee_size:1 ; - scenario_with_layer1_legacy_and_rollup_nodes - ~hooks - ~__FILE__ - ~tags:["dac"; "dac_node"] - ~threshold:0 - ~committee_size:0 - "dac_retrieve_preimage" - Legacy.test_dac_node_handles_dac_retrieve_preimage_merkle_V0 - protocols ; - scenario_with_layer1_legacy_and_rollup_nodes - ~hooks - ~__FILE__ - ~tags:["dac"; "dac_node"] - "dac_rollup_arith_uses_reveals" - Legacy.test_rollup_arith_uses_reveals - protocols - ~threshold:1 - ~committee_size:1 ; scenario_with_layer1_and_legacy_dac_nodes ~__FILE__ ~threshold:0 diff --git a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_retrieve_preimage).out b/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_retrieve_preimage).out deleted file mode 100644 index 3178c0169eb3fb274e85ac378bb153f01cd0bcbc..0000000000000000000000000000000000000000 --- a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_retrieve_preimage).out +++ /dev/null @@ -1,35 +0,0 @@ - -./octez-client --wait none originate smart rollup rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string with kernel --burn-cap 9999999 -Node is bootstrapped. -Estimated gas: 1929.997 units (will add 100 for safety) -Estimated storage: 6552 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.000439 - Expected counter: 1 - Gas limit: 2030 - Storage limit: 6572 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000439 - payload fees(the block proposer) ....... +ꜩ0.000439 - Smart rollup origination: - Kind: arith - Parameter type: string - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' - This smart rollup origination was successfully applied - Consumed gas: 1929.964 - Storage size: 6552 bytes - Address: [SMART_ROLLUP_HASH] - Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1.638 - storage fees ........................... +ꜩ1.638 - -Smart rollup [SMART_ROLLUP_HASH] memorized as "rollup" diff --git a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_reveals_data_hash_chain_v0).out b/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_reveals_data_hash_chain_v0).out deleted file mode 100644 index 3178c0169eb3fb274e85ac378bb153f01cd0bcbc..0000000000000000000000000000000000000000 --- a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_reveals_data_hash_chain_v0).out +++ /dev/null @@ -1,35 +0,0 @@ - -./octez-client --wait none originate smart rollup rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string with kernel --burn-cap 9999999 -Node is bootstrapped. -Estimated gas: 1929.997 units (will add 100 for safety) -Estimated storage: 6552 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.000439 - Expected counter: 1 - Gas limit: 2030 - Storage limit: 6572 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000439 - payload fees(the block proposer) ....... +ꜩ0.000439 - Smart rollup origination: - Kind: arith - Parameter type: string - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' - This smart rollup origination was successfully applied - Consumed gas: 1929.964 - Storage size: 6552 bytes - Address: [SMART_ROLLUP_HASH] - Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1.638 - storage fees ........................... +ꜩ1.638 - -Smart rollup [SMART_ROLLUP_HASH] memorized as "rollup" diff --git a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_reveals_data_merkle_tree_v0).out b/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_reveals_data_merkle_tree_v0).out deleted file mode 100644 index 3178c0169eb3fb274e85ac378bb153f01cd0bcbc..0000000000000000000000000000000000000000 --- a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_reveals_data_merkle_tree_v0).out +++ /dev/null @@ -1,35 +0,0 @@ - -./octez-client --wait none originate smart rollup rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string with kernel --burn-cap 9999999 -Node is bootstrapped. -Estimated gas: 1929.997 units (will add 100 for safety) -Estimated storage: 6552 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.000439 - Expected counter: 1 - Gas limit: 2030 - Storage limit: 6572 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000439 - payload fees(the block proposer) ....... +ꜩ0.000439 - Smart rollup origination: - Kind: arith - Parameter type: string - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' - This smart rollup origination was successfully applied - Consumed gas: 1929.964 - Storage size: 6552 bytes - Address: [SMART_ROLLUP_HASH] - Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1.638 - storage fees ........................... +ꜩ1.638 - -Smart rollup [SMART_ROLLUP_HASH] memorized as "rollup" diff --git a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_rollup_arith_uses_reveals).out b/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_rollup_arith_uses_reveals).out deleted file mode 100644 index 31bd6d0870582c66f126cd3292af3c26585c0c69..0000000000000000000000000000000000000000 --- a/tezt/tests/expected/dac.ml/Alpha- Testing DAC rollup and node with L1 (dac_rollup_arith_uses_reveals).out +++ /dev/null @@ -1,67 +0,0 @@ - -./octez-client --wait none originate smart rollup rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string with kernel --burn-cap 9999999 -Node is bootstrapped. -Estimated gas: 1929.997 units (will add 100 for safety) -Estimated storage: 6552 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.000439 - Expected counter: 1 - Gas limit: 2030 - Storage limit: 6572 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000439 - payload fees(the block proposer) ....... +ꜩ0.000439 - Smart rollup origination: - Kind: arith - Parameter type: string - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' - This smart rollup origination was successfully applied - Consumed gas: 1929.964 - Storage size: 6552 bytes - Address: [SMART_ROLLUP_HASH] - Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1.638 - storage fees ........................... +ꜩ1.638 - -Smart rollup [SMART_ROLLUP_HASH] memorized as "rollup" - -./octez-client rpc get '/chains/main/blocks/head/context/smart_rollups/smart_rollup/[SMART_ROLLUP_HASH]/genesis_info' -{ "level": 2, - "commitment_hash": "[SC_ROLLUP_COMMITMENT_HASH]" } - -./octez-client --wait none send smart rollup message 'text:["hash:0027782d2a7020be332cc42c4e66592ec50305f559a4011981f1d5af81428e7aa3"]' from bootstrap2 -Node is bootstrapped. -Estimated gas: 172.901 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000331 - Expected counter: 1 - Gas limit: 273 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000331 - payload fees(the block proposer) ....... +ꜩ0.000331 - Smart rollup messages submission: - This smart rollup messages submission was successfully applied - Consumed gas: 172.835 - - -./octez-smart-rollup-client-alpha get state value for vars/value --block head -"\000\000\128\000"