From f077266b439256493923995884f471aa8032383a Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Wed, 24 Aug 2022 14:27:09 +0200 Subject: [PATCH 1/4] Proto: append [Receipt] with [Sc_rollup_refutation_rewards] --- src/proto_alpha/lib_client/operation_result.ml | 1 + src/proto_alpha/lib_protocol/alpha_context.mli | 1 + src/proto_alpha/lib_protocol/receipt_repr.ml | 11 +++++++++++ src/proto_alpha/lib_protocol/receipt_repr.mli | 1 + .../lib_protocol/test/unit/test_receipt.ml | 3 ++- 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 1a96ee9c1437..d6dd019c50fd 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -466,6 +466,7 @@ let pp_balance_updates ppf balance_updates = | 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 diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 8dfdd9cddf77..7e9167f3961f 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2392,6 +2392,7 @@ module Receipt : sig | Tx_rollup_rejection_punishments | Tx_rollup_rejection_rewards | Sc_rollup_refutation_punishments + | Sc_rollup_refutation_rewards val compare_balance : balance -> balance -> int diff --git a/src/proto_alpha/lib_protocol/receipt_repr.ml b/src/proto_alpha/lib_protocol/receipt_repr.ml index a0b66916ba46..4d8bfa8e7a87 100644 --- a/src/proto_alpha/lib_protocol/receipt_repr.ml +++ b/src/proto_alpha/lib_protocol/receipt_repr.ml @@ -47,6 +47,7 @@ type balance = | Tx_rollup_rejection_punishments | Tx_rollup_rejection_rewards | Sc_rollup_refutation_punishments + | Sc_rollup_refutation_rewards let balance_encoding = let open Data_encoding in @@ -241,6 +242,15 @@ let balance_encoding = (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) @@ -286,6 +296,7 @@ let compare_balance ba bb = | 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) diff --git a/src/proto_alpha/lib_protocol/receipt_repr.mli b/src/proto_alpha/lib_protocol/receipt_repr.mli index aba8195d40f4..d651c9f33560 100644 --- a/src/proto_alpha/lib_protocol/receipt_repr.mli +++ b/src/proto_alpha/lib_protocol/receipt_repr.mli @@ -48,6 +48,7 @@ type balance = | 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 diff --git a/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml b/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml index 49854e2054ac..1aa4c7bce8f3 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml @@ -96,6 +96,7 @@ let test_encodings () = 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 + test_encodings Sc_rollup_refutation_punishments >>=? fun () -> + test_encodings Sc_rollup_refutation_rewards let tests = Tztest.[tztest "receipt - encoding" `Quick test_encodings] -- GitLab From 8444a8334526558dec46637ee4d40a2a161662e5 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Wed, 24 Aug 2022 14:36:48 +0200 Subject: [PATCH 2/4] Proto: append [Token] with [`Sc_rollup_refutation_rewards] --- docs/alpha/token_management.rst | 3 ++- src/proto_alpha/lib_protocol/alpha_context.mli | 1 + src/proto_alpha/lib_protocol/token.ml | 4 +++- src/proto_alpha/lib_protocol/token.mli | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/alpha/token_management.rst b/docs/alpha/token_management.rst index d4b2622bd50a..4f6348b43973 100644 --- a/docs/alpha/token_management.rst +++ b/docs/alpha/token_management.rst @@ -67,7 +67,8 @@ The value of the additional field ``category`` designates one of the following f * ``"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 +* ``"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. diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 7e9167f3961f..54bba0ac5340 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4591,6 +4591,7 @@ module Token : sig | `Minted | `Liquidity_baking_subsidies | `Tx_rollup_rejection_rewards + | `Sc_rollup_refutation_rewards | container ] type sink = diff --git a/src/proto_alpha/lib_protocol/token.ml b/src/proto_alpha/lib_protocol/token.ml index 6e1de3ef5230..072cb8e262a4 100644 --- a/src/proto_alpha/lib_protocol/token.ml +++ b/src/proto_alpha/lib_protocol/token.ml @@ -42,7 +42,8 @@ type infinite_source = | `Baking_bonuses | `Minted | `Liquidity_baking_subsidies - | `Tx_rollup_rejection_rewards ] + | `Tx_rollup_rejection_rewards + | `Sc_rollup_refutation_rewards ] type source = [infinite_source | container] @@ -174,6 +175,7 @@ let spend ctxt src amount origin = | `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 -> ( diff --git a/src/proto_alpha/lib_protocol/token.mli b/src/proto_alpha/lib_protocol/token.mli index e7ff1c45c6b5..6610e1e74324 100644 --- a/src/proto_alpha/lib_protocol/token.mli +++ b/src/proto_alpha/lib_protocol/token.mli @@ -63,7 +63,8 @@ type infinite_source = | `Baking_bonuses | `Minted | `Liquidity_baking_subsidies - | `Tx_rollup_rejection_rewards ] + | `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. *) -- GitLab From fd22b2f54e219c7a6efc5232d302c918870a26af Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Wed, 24 Aug 2022 15:25:42 +0200 Subject: [PATCH 3/4] Scoru,Proto: reward the refutation game's winner --- .../sc_rollup_refutation_storage.ml | 22 ++++++++++++++++--- .../Alpha- refutation game timeout.out | 2 ++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/proto_alpha/lib_protocol/sc_rollup_refutation_storage.ml b/src/proto_alpha/lib_protocol/sc_rollup_refutation_storage.ml index 402bf746a1ed..6a316e6200fa 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_refutation_storage.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_refutation_storage.ml @@ -323,20 +323,36 @@ let timeout ctxt rollup stakers = in return (Sc_rollup_game_repr.{loser = game.turn; reason = Timeout}, ctxt) +let reward ctxt winner = + let open Lwt_tzresult_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_outcome ctxt rollup stakers (outcome : Sc_rollup_game_repr.outcome) = let open Lwt_tzresult_syntax in let losing_staker = Sc_rollup_game_repr.Index.staker stakers outcome.loser in - let* ctxt, balance_updates = - Stake_storage.remove_staker ctxt rollup losing_staker + let winning_staker = + let loser_opponent = Sc_rollup_game_repr.opponent outcome.loser in + Sc_rollup_game_repr.Index.staker stakers loser_opponent in + let* ctxt, balance_updates_winner = reward ctxt winning_staker in let* ctxt, _, _ = Store.Game.remove (ctxt, rollup) stakers in + let* ctxt, balance_updates_loser = + Stake_storage.remove_staker ctxt rollup losing_staker + in let* ctxt, _, _ = Store.Game_timeout.remove (ctxt, rollup) stakers in let* ctxt, _, _ = Store.Opponent.remove (ctxt, rollup) stakers.alice in let* ctxt, _, _ = Store.Opponent.remove (ctxt, rollup) stakers.bob in return ( Sc_rollup_game_repr.Ended (outcome.reason, losing_staker), ctxt, - balance_updates ) + balance_updates_loser @ balance_updates_winner ) module Internal_for_tests = struct let get_conflict_point = get_conflict_point diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- refutation game timeout.out b/tezt/tests/expected/sc_rollup.ml/Alpha- refutation game timeout.out index 3e4a3c91236f..fcc68f9d64ca 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- refutation game timeout.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- refutation game timeout.out @@ -323,4 +323,6 @@ This sequence of operations was run: Balance updates: Frozen_bonds([PUBLIC_KEY_HASH],[SC_ROLLUP_HASH]) ... -ꜩ10000 sc rollup refutation punishments ........................................................... +ꜩ10000 + sc rollup refutation rewards ............................................................... -ꜩ5000 + [PUBLIC_KEY_HASH] ....................................................... +ꜩ5000 -- GitLab From 960161d9956f1af0443f639e3002c2f3b96e2ed3 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Wed, 24 Aug 2022 15:25:54 +0200 Subject: [PATCH 4/4] Scoru,Test: check the reward and punishement of a refutation game --- ...ation- check the punishment and reward.out | 140 ++++++++++++++++++ tezt/tests/sc_rollup.ml | 127 +++++++++++++++- 2 files changed, 266 insertions(+), 1 deletion(-) create mode 100644 tezt/tests/expected/sc_rollup.ml/Alpha- refutation- check the punishment and reward.out diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- refutation- check the punishment and reward.out b/tezt/tests/expected/sc_rollup.ml/Alpha- refutation- check the punishment and reward.out new file mode 100644 index 000000000000..4093f13e0868 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- refutation- check the punishment and reward.out @@ -0,0 +1,140 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind arith of type unit booting with --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3110.429 units (will add 100 for safety) +Estimated storage: 6651 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 + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000674 + Expected counter: 1 + Gas limit: 3211 + Storage limit: 6671 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000674 + payload fees(the block proposer) ....... +ꜩ0.000674 + Smart contract rollup origination: + Kind: arith + Parameter type: unit + Boot sector: '' + This smart contract rollup origination was successfully applied + Consumed gas: 3110.429 + Storage size: 6651 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1.66275 + storage fees ........................... +ꜩ1.66275 + + +./tezos-client --wait none publish commitment from '[PUBLIC_KEY_HASH]' for sc rollup '[SC_ROLLUP_HASH]' with compressed state scs11VNjWyZw4Tgbvsom8epQbox86S2CKkE1UAZkXMM7Pj8MQMLzMf at inbox level 4 and predecessor '[SC_ROLLUP_COMMITMENT_HASH]' and number of ticks 1 +Node is bootstrapped. +Estimated gas: 5781.683 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000926 + Expected counter: 1 + Gas limit: 5882 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000926 + payload fees(the block proposer) ....... +ꜩ0.000926 + Smart contract rollup commitment publishing: + Address: [SC_ROLLUP_HASH] + Commitment: + compressed_state: scs11VNjWyZw4Tgbvsom8epQbox86S2CKkE1UAZkXMM7Pj8MQMLzMf + inbox_level: 4 + predecessor: [SC_ROLLUP_COMMITMENT_HASH] + number_of_ticks: 1 + This smart contract rollup commitment publishing was successfully applied + Consumed gas: 5781.683 + Hash of commit: [SC_ROLLUP_COMMITMENT_HASH] + Commitment published at level: 5 + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[SC_ROLLUP_HASH]) ... +ꜩ10000 + + +./tezos-client --wait none publish commitment from '[PUBLIC_KEY_HASH]' for sc rollup '[SC_ROLLUP_HASH]' with compressed state scs11VNjWyZw4Tgbvsom8epQbox86S2CKkE1UAZkXMM7Pj8MQMLzMf at inbox level 4 and predecessor '[SC_ROLLUP_COMMITMENT_HASH]' and number of ticks 2 +Node is bootstrapped. +Estimated gas: 5781.683 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000926 + Expected counter: 1 + Gas limit: 5882 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000926 + payload fees(the block proposer) ....... +ꜩ0.000926 + Smart contract rollup commitment publishing: + Address: [SC_ROLLUP_HASH] + Commitment: + compressed_state: scs11VNjWyZw4Tgbvsom8epQbox86S2CKkE1UAZkXMM7Pj8MQMLzMf + inbox_level: 4 + predecessor: [SC_ROLLUP_COMMITMENT_HASH] + number_of_ticks: 2 + This smart contract rollup commitment publishing was successfully applied + Consumed gas: 5781.683 + Hash of commit: [SC_ROLLUP_COMMITMENT_HASH] + Commitment published at level: 6 + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[SC_ROLLUP_HASH]) ... +ꜩ10000 + + +./tezos-client --wait none timeout dispute on sc rollup '[SC_ROLLUP_HASH]' with '[PUBLIC_KEY_HASH]' from bootstrap1 +Node is bootstrapped. +Estimated gas: 6460.680 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000964 + Expected counter: 2 + Gas limit: 6561 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000964 + payload fees(the block proposer) ....... +ꜩ0.000964 + Smart contract rollup refutation timeout: + Address: [SC_ROLLUP_HASH] + First staker (Alice): [PUBLIC_KEY_HASH] + Second staker (Bob): [PUBLIC_KEY_HASH] + This smart contract rollup refutation timeout was successfully applied + Consumed gas: 6460.680 + Refutation game status: Game ended due to timeout, [PUBLIC_KEY_HASH] loses their stake + Balance updates: + Frozen_bonds([PUBLIC_KEY_HASH],[SC_ROLLUP_HASH]) ... -ꜩ10000 + sc rollup refutation punishments ........................................................... +ꜩ10000 + sc rollup refutation rewards ............................................................... -ꜩ5000 + [PUBLIC_KEY_HASH] ....................................................... +ꜩ5000 + diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index c04abf4f2843..feaf7e7bc3d2 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -2764,6 +2764,130 @@ let test_timeout protocols = timeout ~sc_rollup ~staker:operator2.public_key_hash client) protocols +let test_refutation_reward_and_punishment protocols = + regression_test + ~__FILE__ + ~tags:["l1"; "refutation"; "stake"; "reward"; "punishment"] + "refutation: check the punishment and reward" + (fun protocol -> + (* Timeout is the easiest way to end a game, we set timeout period + low to produce an outcome quickly. *) + let timeout_period = 3 in + let commitment_period = 2 in + setup ~commitment_period ~timeout:timeout_period ~protocol + @@ fun node client _ -> + let* {commitment_period_in_blocks; stake_amount; _} = + get_sc_rollup_constants client + in + let punishment = Tez.to_mutez stake_amount in + let reward = punishment / 2 in + (* Originate a Sc rollup. *) + let* sc_rollup = originate_sc_rollup client ~parameters_ty:"unit" in + + (* Pick the two players and their initial balances. *) + let operator1 = Constant.bootstrap2 in + let operator2 = Constant.bootstrap3 in + + let* operator1_balances = + contract_balances ~pkh:operator1.public_key_hash client + in + let* operator2_balances = + contract_balances ~pkh:operator2.public_key_hash client + in + + (* Retrieve the origination commitment *) + let* c0, _ = last_cemented_commitment_hash_with_level ~sc_rollup client in + + (* Compute the inbox level for which we'd like to commit *) + let starting_level = Node.get_level node in + let inbox_level = starting_level + commitment_period_in_blocks in + (* d is the delta between the target inbox level and the current level *) + let d = inbox_level - Node.get_level node in + (* Bake sufficiently many blocks to be able to commit for the desired inbox + level. We may actually bake no blocks if d <= 0 *) + let* () = repeat d (fun () -> Client.bake_for_and_wait client) in + + (* [operator1] stakes on a commitment. *) + let* _ = + publish_dummy_commitment + ~inbox_level + ~predecessor:c0 + ~sc_rollup + ~number_of_ticks:1 + ~src:operator1.public_key_hash + client + in + let* new_operator1_balances = + contract_balances ~pkh:operator1.public_key_hash client + in + + Check.( + (new_operator1_balances.frozen + = operator1_balances.frozen + Tez.to_mutez stake_amount) + int + ~error_msg:"expecting frozen balance for operator1: %R, got %L") ; + + (* [operator2] stakes on a commitment. *) + let* _ = + publish_dummy_commitment + ~inbox_level + ~predecessor:c0 + ~sc_rollup + ~number_of_ticks:2 + ~src:operator2.public_key_hash + client + in + let* new_operator2_balances = + contract_balances ~pkh:operator2.public_key_hash client + in + Check.( + (new_operator2_balances.frozen + = operator2_balances.frozen + Tez.to_mutez stake_amount) + int + ~error_msg:"expecting frozen balance for operator2: %R, got %L") ; + + let module M = Operation.Manager in + (* [operator1] starts a dispute, but will never play. *) + let* () = + bake_operation_via_rpc client + @@ M.make ~source:operator1 + @@ M.sc_rollup_refute ~sc_rollup ~opponent:operator2.public_key_hash () + in + (* Get exactly to the block where we are able to timeout. *) + let* () = + repeat (timeout_period + 1) (fun () -> Client.bake_for_and_wait client) + in + let* () = timeout ~sc_rollup ~staker:operator2.public_key_hash client in + + (* The game should have now ended. *) + + (* [operator2] wins half of the opponent's stake. *) + let* final_operator2_balances = + contract_balances ~pkh:operator2.public_key_hash client + in + Check.( + (final_operator2_balances.frozen = new_operator2_balances.frozen) + int + ~error_msg:"operator2 should keep its frozen deposit: %R, got %L") ; + Check.( + (final_operator2_balances.liquid + = new_operator2_balances.liquid + reward) + int + ~error_msg:"operator2 should win a reward: %R, got %L") ; + + (* [operator1] loses all its stake. *) + let* final_operator1_balances = + contract_balances ~pkh:operator1.public_key_hash client + in + Check.( + (final_operator1_balances.frozen + = new_operator1_balances.frozen - punishment) + int + ~error_msg:"operator1 should lose its frozen deposit: %R, got %L") ; + + unit) + protocols + let register ~kind ~protocols = test_origination ~kind protocols ; test_rollup_node_running ~kind protocols ; @@ -2885,4 +3009,5 @@ let register ~protocols = register ~kind:"arith" ~protocols ; test_no_cementation_if_parent_not_lcc_or_if_disputed_commit protocols ; test_valid_dispute_dissection protocols ; - test_timeout protocols + test_timeout protocols ; + test_refutation_reward_and_punishment protocols -- GitLab