diff --git a/src/proto_alpha/lib_protocol/src/alpha_context.mli b/src/proto_alpha/lib_protocol/src/alpha_context.mli index d10411fb7..774b43c0d 100644 --- a/src/proto_alpha/lib_protocol/src/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/src/alpha_context.mli @@ -260,7 +260,7 @@ module Constants : sig val nonce_length: int val seed_nonce_revelation_tip: Tez.t val origination_burn: Tez.t - val baking_bond_cost: Tez.t + val block_security_deposit: Tez.t val endorsement_bond_cost: Tez.t val faucet_credit: Tez.t diff --git a/src/proto_alpha/lib_protocol/src/baking.ml b/src/proto_alpha/lib_protocol/src/baking.ml index 6a0669ffc..f7c283938 100644 --- a/src/proto_alpha/lib_protocol/src/baking.ml +++ b/src/proto_alpha/lib_protocol/src/baking.ml @@ -134,7 +134,7 @@ let freeze_baking_bond ctxt { Block_header.priority ; _ } delegate = if Compare.Int.(priority >= Constants.first_free_baking_slot ctxt) then return (ctxt, Tez.zero) else - let bond = Constants.baking_bond_cost in + let bond = Constants.block_security_deposit in Delegate.freeze_bond ctxt delegate bond |> trace Cannot_freeze_baking_bond >>=? fun ctxt -> return (ctxt, bond) diff --git a/src/proto_alpha/lib_protocol/src/baking.mli b/src/proto_alpha/lib_protocol/src/baking.mli index 251b22d5a..5b6e8af97 100644 --- a/src/proto_alpha/lib_protocol/src/baking.mli +++ b/src/proto_alpha/lib_protocol/src/baking.mli @@ -29,7 +29,7 @@ val paying_priorities: context -> int list val minimal_time: context -> int -> Time.t -> Time.t tzresult Lwt.t (** [freeze_baking_bond: ctxt delegate priority] - Freeze the baking bond (See !Constants.baking_bond_cost) + Freeze the baking bond (See !Constants.block_security_deposit) from a delegate account. No bond is frozen if the baking priority of this block is greater than the maximum number of paying baking in the network (meaning that n. bakers diff --git a/src/proto_alpha/lib_protocol/src/constants_repr.ml b/src/proto_alpha/lib_protocol/src/constants_repr.ml index c7283f242..a5126cb3d 100644 --- a/src/proto_alpha/lib_protocol/src/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/src/constants_repr.ml @@ -21,7 +21,7 @@ let origination_burn = Tez_repr.one (* 512 tez *) -let baking_bond_cost = +let block_security_deposit = Tez_repr.(mul_exn one 512) (* 64 tez *) diff --git a/src/proto_alpha/lib_protocol/test/test_endorsement.ml b/src/proto_alpha/lib_protocol/test/test_endorsement.ml index abdf7376f..d701bc007 100644 --- a/src/proto_alpha/lib_protocol/test/test_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/test_endorsement.ml @@ -72,11 +72,11 @@ let test_endorsement_payment () = let endorsement_bond_cost = Constants.endorsement_bond_cost in let baking = baker_hpub = contract_p.hpub && block_priority < 4 in - let baking_bond_cost = + let block_security_deposit = if baking - then Constants.baking_bond_cost + then Constants.block_security_deposit else Tez.zero in - let cost = Cast.tez_add endorsement_bond_cost baking_bond_cost in + let cost = Cast.tez_add endorsement_bond_cost block_security_deposit in let expected_balance = Cast.tez_sub init_balance cost in Assert.equal_tez ~msg: __LOC__ expected_balance bond_balance ; (* After one cycle, (4 blocks in test/proto_alpha/sandbox),