diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index 1327428db3ca8318c4561681a0dfd412a9c37143..3dd2bbc73aed5f43cf595c3183c1dddf08b72e65 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -107,6 +107,11 @@ Adaptive Issuance (ongoing) - Adjust total supply tracked for AI (estimated in O) so that it matches the actual total supply. (MR :gl:`!11996`) +- Add min_delegated_in_current_cycle field in delegates info obtained via ``GET '/chains/main/blocks/[BLOCK_ID]]/context/delegates/[PUBLIC_KEY_HASH]'`` (MR :gl:`!12018``) + +- Add RPC to get min_delegated_in_current_cycle for a delegate using ``GET '/chains/main/blocks/[BLOCK_ID]]/context/delegates/[PUBLIC_KEY_HASH]/min_delegated_in_current_cycle'`` (MR :gl:`!12018`) + + Gas improvements ---------------- diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 5e40d58c7443a3111f0bfe9b44913ae8725f7ddc..697bc0095a7b3e4cb21d41b55fd1a8b062eb3a39 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2488,6 +2488,9 @@ module Delegate : sig val staking_balance : context -> public_key_hash -> Tez.t tzresult Lwt.t + val min_delegated_in_current_cycle : + context -> public_key_hash -> Tez.t tzresult Lwt.t + val pending_denunciations : context -> public_key_hash -> Denunciations_repr.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/delegate_services.ml b/src/proto_alpha/lib_protocol/delegate_services.ml index d9637326456292def6b7b70bae89ceca99fa902d..4ce7a47a6336e9daab87deec1c33ae60a0b2465f 100644 --- a/src/proto_alpha/lib_protocol/delegate_services.ml +++ b/src/proto_alpha/lib_protocol/delegate_services.ml @@ -116,6 +116,7 @@ type info = { frozen_deposits_limit : Tez.t option; delegated_contracts : Contract.t list; delegated_balance : Tez.t; + min_delegated_in_current_cycle : Tez.t; total_delegated_stake : Tez.t; staking_denominator : Staking_pseudotoken.t; deactivated : bool; @@ -136,6 +137,7 @@ let info_encoding = frozen_deposits_limit; delegated_contracts; delegated_balance; + min_delegated_in_current_cycle; total_delegated_stake; staking_denominator; deactivated; @@ -151,6 +153,7 @@ let info_encoding = frozen_deposits_limit, delegated_contracts, delegated_balance, + min_delegated_in_current_cycle, deactivated, grace_period ), ( (total_delegated_stake, staking_denominator), @@ -162,6 +165,7 @@ let info_encoding = frozen_deposits_limit, delegated_contracts, delegated_balance, + min_delegated_in_current_cycle, deactivated, grace_period ), ( (total_delegated_stake, staking_denominator), @@ -174,6 +178,7 @@ let info_encoding = frozen_deposits_limit; delegated_contracts; delegated_balance; + min_delegated_in_current_cycle; total_delegated_stake; staking_denominator; deactivated; @@ -183,7 +188,7 @@ let info_encoding = pending_consensus_keys; }) (merge_objs - (obj9 + (obj10 (req "full_balance" Tez.encoding) (req "current_frozen_deposits" Tez.encoding) (req "frozen_deposits" Tez.encoding) @@ -191,6 +196,7 @@ let info_encoding = (opt "frozen_deposits_limit" Tez.encoding) (req "delegated_contracts" (list Contract.encoding)) (req "delegated_balance" Tez.encoding) + (req "min_delegated_in_current_cycle" Tez.encoding) (req "deactivated" bool) (req "grace_period" Cycle.encoding)) (merge_objs @@ -405,6 +411,15 @@ module S = struct ~output:Tez.encoding RPC_path.(path / "delegated_balance") + let min_delegated_in_current_cycle = + RPC_service.get_service + ~description: + "Returns the minimum of delegated tez (in mutez) over the current \ + cycle." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(path / "min_delegated_in_current_cycle") + let deactivated = RPC_service.get_service ~description: @@ -578,6 +593,9 @@ let register () = let* frozen_deposits_limit = Delegate.frozen_deposits_limit ctxt pkh in let*! delegated_contracts = Delegate.delegated_contracts ctxt pkh in let* delegated_balance = Delegate.For_RPC.delegated_balance ctxt pkh in + let* min_delegated_in_current_cycle = + Delegate.For_RPC.min_delegated_in_current_cycle ctxt pkh + in let* total_delegated_stake = Staking_pseudotokens.For_RPC.get_frozen_deposits_staked_tez ctxt @@ -604,6 +622,7 @@ let register () = frozen_deposits_limit; delegated_contracts; delegated_balance; + min_delegated_in_current_cycle; total_delegated_stake; staking_denominator; deactivated; @@ -666,6 +685,12 @@ let register () = register1 ~chunked:false S.delegated_balance (fun ctxt pkh () () -> let* () = check_delegate_registered ctxt pkh in Delegate.For_RPC.delegated_balance ctxt pkh) ; + register1 + ~chunked:false + S.min_delegated_in_current_cycle + (fun ctxt pkh () () -> + let* () = check_delegate_registered ctxt pkh in + Delegate.For_RPC.min_delegated_in_current_cycle ctxt pkh) ; register1 ~chunked:false S.total_delegated_stake (fun ctxt pkh () () -> let* () = check_delegate_registered ctxt pkh in Staking_pseudotokens.For_RPC.get_frozen_deposits_staked_tez diff --git a/src/proto_alpha/lib_protocol/delegate_services.mli b/src/proto_alpha/lib_protocol/delegate_services.mli index 17cb85ed0b558b0d6a220b0eb556cdd00c93e912..be7bc658573359105023cd059bc12496f91a9cef 100644 --- a/src/proto_alpha/lib_protocol/delegate_services.mli +++ b/src/proto_alpha/lib_protocol/delegate_services.mli @@ -61,6 +61,7 @@ type info = { frozen_deposits_limit : Tez.t option; delegated_contracts : Contract.t list; delegated_balance : Tez.t; + min_delegated_in_current_cycle : Tez.t; total_delegated_stake : Tez.t; staking_denominator : Staking_pseudotoken.t; deactivated : bool; diff --git a/src/proto_alpha/lib_protocol/delegate_storage.ml b/src/proto_alpha/lib_protocol/delegate_storage.ml index b588082584542599f221f00ab2b27dfdf4b6ffa6..75fea2802c5cee71cab82b933eebafbcf421252d 100644 --- a/src/proto_alpha/lib_protocol/delegate_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_storage.ml @@ -392,6 +392,19 @@ module For_RPC = struct Stake_storage.For_RPC.get_staking_balance ctxt delegate else return Tez_repr.zero + let min_delegated_in_current_cycle ctxt delegate = + let open Lwt_result_syntax in + let current_cycle = (Raw_context.current_level ctxt).cycle in + let*! is_registered = registered ctxt delegate in + if is_registered then + let+ staking_balance = + Stake_storage.get_full_staking_balance ctxt delegate + in + Full_staking_balance_repr.min_delegated_in_cycle + ~current_cycle + staking_balance + else return Tez_repr.zero + let delegated_balance ctxt delegate = let open Lwt_result_syntax in let* staking_balance = staking_balance ctxt delegate in diff --git a/src/proto_alpha/lib_protocol/delegate_storage.mli b/src/proto_alpha/lib_protocol/delegate_storage.mli index 7593b5c85404a7414147b7fdd624358a853d1906..58c91f85e8e53aa60c8252bd332f4c54671c17b7 100644 --- a/src/proto_alpha/lib_protocol/delegate_storage.mli +++ b/src/proto_alpha/lib_protocol/delegate_storage.mli @@ -160,4 +160,7 @@ module For_RPC : sig val staking_balance : Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t + + val min_delegated_in_current_cycle : + Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t end diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.ml b/src/proto_alpha/lib_protocol/test/helpers/context.ml index db2eb18093b5bd7753a5d734b3629d296403c19b..f8dad7726763247c0c7fa76cb2427365db870f91 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/context.ml @@ -481,6 +481,7 @@ module Delegate = struct frozen_deposits_limit : Tez.t option; delegated_contracts : Alpha_context.Contract.t list; delegated_balance : Tez.t; + min_delegated_in_current_cycle : Tez.t; total_delegated_stake : Tez.t; staking_denominator : Staking_pseudotoken.t; deactivated : bool; diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.mli b/src/proto_alpha/lib_protocol/test/helpers/context.mli index a90a8ba85b3d29e9dda95847541843ebdd95d4f0..16cee0d26ffa9d59a98cb610d492f1c5ef9637a6 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/context.mli @@ -250,6 +250,7 @@ module Delegate : sig frozen_deposits_limit : Tez.t option; delegated_contracts : Alpha_context.Contract.t list; delegated_balance : Tez.t; + min_delegated_in_current_cycle : Tez.t; total_delegated_stake : Tez.t; staking_denominator : Staking_pseudotoken.t; deactivated : bool; diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out index 9528e8733acd2976f3a538cd33066f7e3751a26d..6b257eca7b6f04c1e62f6fa727c12e9220319c16 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out @@ -20,9 +20,11 @@ { "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, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 5, "total_delegated_stake": "0", + "staking_denominator": "0", "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' diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out index 06e165d99971f2df9d72c9bf89d319e620b9a572..a6d3e60d3c920dc9d80279354e713f9801a9e96f 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out @@ -20,9 +20,11 @@ { "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, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 5, "total_delegated_stake": "0", + "staking_denominator": "0", "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' diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out index 0e3cf04b9ddac76e7b86dfe8dde40402fef1328c..eb6bf7c4a23e70d62a5865b7552e8dfc84dafb99 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out @@ -20,9 +20,11 @@ { "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, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 5, "total_delegated_stake": "0", + "staking_denominator": "0", "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' diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- delegates.out index 9528e8733acd2976f3a538cd33066f7e3751a26d..6b257eca7b6f04c1e62f6fa727c12e9220319c16 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- delegates.out @@ -20,9 +20,11 @@ { "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, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 5, "total_delegated_stake": "0", + "staking_denominator": "0", "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' diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- delegates.out index 9528e8733acd2976f3a538cd33066f7e3751a26d..6b257eca7b6f04c1e62f6fa727c12e9220319c16 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- delegates.out @@ -20,9 +20,11 @@ { "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, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 5, "total_delegated_stake": "0", + "staking_denominator": "0", "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' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out index e066f38f2334459476cf333ed1a04264cb6e8c09..704b30d6e9d36149a1e03fc7e84d8f227e5ca2d8 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out @@ -29,18 +29,22 @@ This sequence of operations was run: { "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": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000000333333", "current_frozen_deposits": "200000016667", "frozen_deposits": "200000000000", "staking_balance": "4000000333333", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3799999999716", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -49,18 +53,22 @@ This sequence of operations was run: { "full_balance": "4000003298113", "current_frozen_deposits": "200000164906", "frozen_deposits": "200000000000", "staking_balance": "4000003298113", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001595660", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000003298113", "current_frozen_deposits": "200000164906", "frozen_deposits": "200000000000", "staking_balance": "4000003298113", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001595660", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' @@ -98,9 +106,10 @@ This sequence of operations was run: { "full_balance": "238000528932", "current_frozen_deposits": "200000181573", "frozen_deposits": "200000083984", "staking_balance": "238000528932", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 4, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", "min_delegated_in_current_cycle": "4", + "deactivated": false, "grace_period": 4, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out index 892b917c3981b6ee50e880c0c2ae83f029ec39e5..dbbd212eaff64d2201472b7930aba3b5d8539b3c 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out @@ -29,18 +29,22 @@ This sequence of operations was run: { "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": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000000333333", "current_frozen_deposits": "200000016667", "frozen_deposits": "200000000000", "staking_balance": "4000000333333", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3799999999716", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -49,18 +53,22 @@ This sequence of operations was run: { "full_balance": "4000003298113", "current_frozen_deposits": "200000164906", "frozen_deposits": "200000000000", "staking_balance": "4000003298113", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001595660", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000003298113", "current_frozen_deposits": "200000164906", "frozen_deposits": "200000000000", "staking_balance": "4000003298113", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001595660", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' @@ -98,9 +106,10 @@ This sequence of operations was run: { "full_balance": "238000528932", "current_frozen_deposits": "200000181573", "frozen_deposits": "200000083984", "staking_balance": "238000528932", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 4, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", "min_delegated_in_current_cycle": "4", + "deactivated": false, "grace_period": 4, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out index f7aefc6ee837e21300c4bc8caac2890774559fe8..97a61ff6bc6495defd4bc41fb3f726eaaa10514d 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out @@ -29,18 +29,22 @@ This sequence of operations was run: { "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": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "3999999999716", "current_frozen_deposits": "200000000000", "frozen_deposits": "200000000000", "staking_balance": "3999999999716", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3799999999716", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -49,18 +53,22 @@ This sequence of operations was run: { "full_balance": "4000002964496", "current_frozen_deposits": "200000148225", "frozen_deposits": "200000000000", "staking_balance": "4000002964496", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001278724", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000002964496", "current_frozen_deposits": "200000148225", "frozen_deposits": "200000000000", "staking_balance": "4000002964496", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001278724", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' @@ -98,9 +106,10 @@ This sequence of operations was run: { "full_balance": "238000509096", "current_frozen_deposits": "200000164892", "frozen_deposits": "200000067317", "staking_balance": "238000509096", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 4, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", "min_delegated_in_current_cycle": "18", + "deactivated": false, "grace_period": 4, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out index 1e092ea539b08eb868db979038e16f1d63300ba9..0ae5f6b77c13d5e0d845a01f873daaab28b6a972 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out @@ -29,18 +29,22 @@ This sequence of operations was run: { "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": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "3999999999716", "current_frozen_deposits": "200000000000", "frozen_deposits": "200000000000", "staking_balance": "3999999999716", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3799999999716", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -49,18 +53,22 @@ This sequence of operations was run: { "full_balance": "4000002964496", "current_frozen_deposits": "200000148225", "frozen_deposits": "200000000000", "staking_balance": "4000002964496", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001278724", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000002964496", "current_frozen_deposits": "200000148225", "frozen_deposits": "200000000000", "staking_balance": "4000002964496", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001278724", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' @@ -98,9 +106,10 @@ This sequence of operations was run: { "full_balance": "238000509096", "current_frozen_deposits": "200000164892", "frozen_deposits": "200000067317", "staking_balance": "238000509096", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 4, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", "min_delegated_in_current_cycle": "18", + "deactivated": false, "grace_period": 4, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out index 3259d73cdb5f6f99d7099fc284c4f83d01cd6415..7bea90479067dab5825f0e773a356203b2061942 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out @@ -64,8 +64,9 @@ This sequence of operations was run: { "full_balance": "999999999385", "current_frozen_deposits": "0", "frozen_deposits": "0", "staking_balance": "999999999385", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", + "delegated_balance": "0", "min_delegated_in_current_cycle": "999999999385", + "deactivated": false, "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -77,6 +78,7 @@ This sequence of operations was run: { "full_balance": "999999999385", "current_frozen_deposits": "49999999970", "frozen_deposits": "0", "staking_balance": "999999999385", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", + "delegated_balance": "0", "min_delegated_in_current_cycle": "949999999415", + "deactivated": false, "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "active_consensus_key": "[PUBLIC_KEY_HASH]" } diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out index e8100cb21f0009704ab8db0e44025b779d0d0a40..1eb937a52cbeb48078c4435ba53d9b28ec8f34e4 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out @@ -29,18 +29,22 @@ This sequence of operations was run: { "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": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "4000000333333", "current_frozen_deposits": "200000016667", "frozen_deposits": "200000000000", "staking_balance": "4000000333333", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3799999999716", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -49,7 +53,9 @@ This sequence of operations was run: { "full_balance": "4000003298113", "current_frozen_deposits": "200000164906", "frozen_deposits": "200000000000", "staking_balance": "4000003298113", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001595660", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" } diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out index c4a3c8433dfe1079a59be327373ddd3a0711cbd6..4444e752bbec72b1557922adc53c48488324a163 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out @@ -29,18 +29,22 @@ This sequence of operations was run: { "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": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800000000000", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "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": "3999999999716", "current_frozen_deposits": "200000000000", "frozen_deposits": "200000000000", "staking_balance": "3999999999716", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3799999999716", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]", "pending_consensus_keys": [ { "cycle": 2, "pkh": "[PUBLIC_KEY_HASH]" } ] } @@ -49,7 +53,9 @@ This sequence of operations was run: { "full_balance": "4000002964496", "current_frozen_deposits": "200000148225", "frozen_deposits": "200000000000", "staking_balance": "4000002964496", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], - "delegated_balance": "0", "deactivated": false, "grace_period": 3, - "total_delegated_stake": "0", "staking_denominator": "0", - "voting_power": "4000000000000", "remaining_proposals": 20, + "delegated_balance": "0", + "min_delegated_in_current_cycle": "3800001278724", "deactivated": false, + "grace_period": 3, "total_delegated_stake": "0", + "staking_denominator": "0", "voting_power": "4000000000000", + "remaining_proposals": 20, "active_consensus_key": "[PUBLIC_KEY_HASH]" }