Alpha: rename max_signing_slot
into endorsers_per_block
This commit is contained in:
parent
43609e2e63
commit
7ef2803199
@ -271,7 +271,7 @@ module Constants : sig
|
|||||||
val voting_period_length: context -> int32
|
val voting_period_length: context -> int32
|
||||||
val time_between_blocks: context -> Period.t list
|
val time_between_blocks: context -> Period.t list
|
||||||
val first_free_baking_slot: context -> int
|
val first_free_baking_slot: context -> int
|
||||||
val max_signing_slot: context -> int
|
val endorsers_per_block: context -> int
|
||||||
val max_gas: context -> int
|
val max_gas: context -> int
|
||||||
val proof_of_work_threshold: context -> int64
|
val proof_of_work_threshold: context -> int64
|
||||||
val dictator_pubkey: context -> Ed25519.Public_key.t
|
val dictator_pubkey: context -> Ed25519.Public_key.t
|
||||||
|
@ -159,8 +159,8 @@ let check_baking_rights c { Block_header.priority ; _ }
|
|||||||
|
|
||||||
let check_endorsements_rights c level slots =
|
let check_endorsements_rights c level slots =
|
||||||
map_p (fun slot ->
|
map_p (fun slot ->
|
||||||
fail_unless Compare.Int.(0 <= slot && slot <= Constants.max_signing_slot c)
|
fail_unless Compare.Int.(0 <= slot && slot <= Constants.endorsers_per_block c)
|
||||||
(Invalid_endorsement_slot (Constants.max_signing_slot c, slot)) >>=? fun () ->
|
(Invalid_endorsement_slot (Constants.endorsers_per_block c, slot)) >>=? fun () ->
|
||||||
Roll.endorsement_rights_owner c level ~slot)
|
Roll.endorsement_rights_owner c level ~slot)
|
||||||
slots >>=? function
|
slots >>=? function
|
||||||
| [] -> fail Empty_endorsement
|
| [] -> fail Empty_endorsement
|
||||||
@ -220,7 +220,7 @@ let first_baking_priorities
|
|||||||
|
|
||||||
let first_endorsement_slots
|
let first_endorsement_slots
|
||||||
ctxt
|
ctxt
|
||||||
?(max_priority = Constants.max_signing_slot ctxt)
|
?(max_priority = Constants.endorsers_per_block ctxt)
|
||||||
delegate level =
|
delegate level =
|
||||||
endorsement_priorities ctxt level >>=? fun delegate_list ->
|
endorsement_priorities ctxt level >>=? fun delegate_list ->
|
||||||
select_delegate delegate delegate_list max_priority
|
select_delegate delegate delegate_list max_priority
|
||||||
@ -255,7 +255,7 @@ let check_signature block key =
|
|||||||
Ed25519.Public_key.hash key))
|
Ed25519.Public_key.hash key))
|
||||||
|
|
||||||
let max_fitness_gap ctxt =
|
let max_fitness_gap ctxt =
|
||||||
let slots = Int64.of_int (Constants.max_signing_slot ctxt + 1) in
|
let slots = Int64.of_int (Constants.endorsers_per_block ctxt + 1) in
|
||||||
Int64.add slots 1L
|
Int64.add slots 1L
|
||||||
|
|
||||||
let check_fitness_gap ctxt (block : Block_header.t) =
|
let check_fitness_gap ctxt (block : Block_header.t) =
|
||||||
|
@ -52,7 +52,7 @@ type constants = {
|
|||||||
voting_period_length: int32 ;
|
voting_period_length: int32 ;
|
||||||
time_between_blocks: Period_repr.t list ;
|
time_between_blocks: Period_repr.t list ;
|
||||||
first_free_baking_slot: int ;
|
first_free_baking_slot: int ;
|
||||||
max_signing_slot: int ;
|
endorsers_per_block: int ;
|
||||||
max_gas: int ;
|
max_gas: int ;
|
||||||
proof_of_work_threshold: int64 ;
|
proof_of_work_threshold: int64 ;
|
||||||
bootstrap_keys: Ed25519.Public_key.t list ;
|
bootstrap_keys: Ed25519.Public_key.t list ;
|
||||||
@ -74,7 +74,7 @@ let default = {
|
|||||||
time_between_blocks =
|
time_between_blocks =
|
||||||
List.map Period_repr.of_seconds_exn [ 60L ] ;
|
List.map Period_repr.of_seconds_exn [ 60L ] ;
|
||||||
first_free_baking_slot = 16 ;
|
first_free_baking_slot = 16 ;
|
||||||
max_signing_slot = 32 ;
|
endorsers_per_block = 32 ;
|
||||||
max_gas = 40_000 ;
|
max_gas = 40_000 ;
|
||||||
proof_of_work_threshold =
|
proof_of_work_threshold =
|
||||||
Int64.(sub (shift_left 1L 56) 1L) ;
|
Int64.(sub (shift_left 1L 56) 1L) ;
|
||||||
@ -134,9 +134,9 @@ let constants_encoding =
|
|||||||
and first_free_baking_slot =
|
and first_free_baking_slot =
|
||||||
opt Compare.Int.(=)
|
opt Compare.Int.(=)
|
||||||
default.first_free_baking_slot c.first_free_baking_slot
|
default.first_free_baking_slot c.first_free_baking_slot
|
||||||
and max_signing_slot =
|
and endorsers_per_block =
|
||||||
opt Compare.Int.(=)
|
opt Compare.Int.(=)
|
||||||
default.max_signing_slot c.max_signing_slot
|
default.endorsers_per_block c.endorsers_per_block
|
||||||
and max_gas =
|
and max_gas =
|
||||||
opt Compare.Int.(=)
|
opt Compare.Int.(=)
|
||||||
default.max_gas c.max_gas
|
default.max_gas c.max_gas
|
||||||
@ -169,7 +169,7 @@ let constants_encoding =
|
|||||||
voting_period_length,
|
voting_period_length,
|
||||||
time_between_blocks,
|
time_between_blocks,
|
||||||
first_free_baking_slot,
|
first_free_baking_slot,
|
||||||
max_signing_slot,
|
endorsers_per_block,
|
||||||
max_gas),
|
max_gas),
|
||||||
( proof_of_work_threshold,
|
( proof_of_work_threshold,
|
||||||
bootstrap_keys,
|
bootstrap_keys,
|
||||||
@ -185,7 +185,7 @@ let constants_encoding =
|
|||||||
voting_period_length,
|
voting_period_length,
|
||||||
time_between_blocks,
|
time_between_blocks,
|
||||||
first_free_baking_slot,
|
first_free_baking_slot,
|
||||||
max_signing_slot,
|
endorsers_per_block,
|
||||||
max_gas),
|
max_gas),
|
||||||
( proof_of_work_threshold,
|
( proof_of_work_threshold,
|
||||||
bootstrap_keys,
|
bootstrap_keys,
|
||||||
@ -209,8 +209,8 @@ let constants_encoding =
|
|||||||
time_between_blocks ;
|
time_between_blocks ;
|
||||||
first_free_baking_slot =
|
first_free_baking_slot =
|
||||||
unopt default.first_free_baking_slot first_free_baking_slot ;
|
unopt default.first_free_baking_slot first_free_baking_slot ;
|
||||||
max_signing_slot =
|
endorsers_per_block =
|
||||||
unopt default.max_signing_slot max_signing_slot ;
|
unopt default.endorsers_per_block endorsers_per_block ;
|
||||||
max_gas =
|
max_gas =
|
||||||
unopt default.max_gas max_gas ;
|
unopt default.max_gas max_gas ;
|
||||||
proof_of_work_threshold =
|
proof_of_work_threshold =
|
||||||
@ -239,7 +239,7 @@ let constants_encoding =
|
|||||||
(opt "voting_period_length" int32)
|
(opt "voting_period_length" int32)
|
||||||
(opt "time_between_blocks" (list Period_repr.encoding))
|
(opt "time_between_blocks" (list Period_repr.encoding))
|
||||||
(opt "first_free_baking_slot" uint16)
|
(opt "first_free_baking_slot" uint16)
|
||||||
(opt "max_signing_slot" uint16)
|
(opt "endorsers_per_block" uint16)
|
||||||
(opt "instructions_per_transaction" int31))
|
(opt "instructions_per_transaction" int31))
|
||||||
(obj7
|
(obj7
|
||||||
(opt "proof_of_work_threshold" int64)
|
(opt "proof_of_work_threshold" int64)
|
||||||
|
@ -72,13 +72,13 @@ module S = struct
|
|||||||
~output: (obj1 (req "first_free_baking_slot" uint16))
|
~output: (obj1 (req "first_free_baking_slot" uint16))
|
||||||
RPC_path.(custom_root / "first_free_baking_slot")
|
RPC_path.(custom_root / "first_free_baking_slot")
|
||||||
|
|
||||||
let max_signing_slot =
|
let endorsers_per_block =
|
||||||
RPC_service.post_service
|
RPC_service.post_service
|
||||||
~description: "Max signing slot"
|
~description: "Max signing slot"
|
||||||
~query: RPC_query.empty
|
~query: RPC_query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "max_signing_slot" uint16))
|
~output: (obj1 (req "endorsers_per_block" uint16))
|
||||||
RPC_path.(custom_root / "max_signing_slot")
|
RPC_path.(custom_root / "endorsers_per_block")
|
||||||
|
|
||||||
let max_gas =
|
let max_gas =
|
||||||
RPC_service.post_service
|
RPC_service.post_service
|
||||||
@ -130,8 +130,8 @@ let () =
|
|||||||
register0 S.first_free_baking_slot begin fun ctxt () () ->
|
register0 S.first_free_baking_slot begin fun ctxt () () ->
|
||||||
return (Constants.first_free_baking_slot ctxt)
|
return (Constants.first_free_baking_slot ctxt)
|
||||||
end ;
|
end ;
|
||||||
register0 S.max_signing_slot begin fun ctxt () () ->
|
register0 S.endorsers_per_block begin fun ctxt () () ->
|
||||||
return (Constants.max_signing_slot ctxt)
|
return (Constants.endorsers_per_block ctxt)
|
||||||
end ;
|
end ;
|
||||||
register0 S.max_gas begin fun ctxt () () ->
|
register0 S.max_gas begin fun ctxt () () ->
|
||||||
return (Constants.max_gas ctxt)
|
return (Constants.max_gas ctxt)
|
||||||
@ -157,8 +157,8 @@ let time_between_blocks ctxt block =
|
|||||||
RPC_context.make_call0 S.time_between_blocks ctxt block () ()
|
RPC_context.make_call0 S.time_between_blocks ctxt block () ()
|
||||||
let first_free_baking_slot ctxt block =
|
let first_free_baking_slot ctxt block =
|
||||||
RPC_context.make_call0 S.first_free_baking_slot ctxt block () ()
|
RPC_context.make_call0 S.first_free_baking_slot ctxt block () ()
|
||||||
let max_signing_slot ctxt block =
|
let endorsers_per_block ctxt block =
|
||||||
RPC_context.make_call0 S.max_signing_slot ctxt block () ()
|
RPC_context.make_call0 S.endorsers_per_block ctxt block () ()
|
||||||
let max_gas ctxt block =
|
let max_gas ctxt block =
|
||||||
RPC_context.make_call0 S.max_gas ctxt block () ()
|
RPC_context.make_call0 S.max_gas ctxt block () ()
|
||||||
let proof_of_work_threshold ctxt block =
|
let proof_of_work_threshold ctxt block =
|
||||||
|
@ -30,7 +30,7 @@ val time_between_blocks:
|
|||||||
val first_free_baking_slot:
|
val first_free_baking_slot:
|
||||||
'a #RPC_context.simple -> 'a -> int shell_tzresult Lwt.t
|
'a #RPC_context.simple -> 'a -> int shell_tzresult Lwt.t
|
||||||
|
|
||||||
val max_signing_slot:
|
val endorsers_per_block:
|
||||||
'a #RPC_context.simple -> 'a -> int shell_tzresult Lwt.t
|
'a #RPC_context.simple -> 'a -> int shell_tzresult Lwt.t
|
||||||
|
|
||||||
val max_gas:
|
val max_gas:
|
||||||
|
@ -28,9 +28,9 @@ let time_between_blocks c =
|
|||||||
let first_free_baking_slot c =
|
let first_free_baking_slot c =
|
||||||
let constants = Raw_context.constants c in
|
let constants = Raw_context.constants c in
|
||||||
constants.first_free_baking_slot
|
constants.first_free_baking_slot
|
||||||
let max_signing_slot c =
|
let endorsers_per_block c =
|
||||||
let constants = Raw_context.constants c in
|
let constants = Raw_context.constants c in
|
||||||
constants.max_signing_slot
|
constants.endorsers_per_block
|
||||||
let max_gas c =
|
let max_gas c =
|
||||||
let constants = Raw_context.constants c in
|
let constants = Raw_context.constants c in
|
||||||
constants.max_gas
|
constants.max_gas
|
||||||
|
@ -251,7 +251,7 @@ module Endorser = struct
|
|||||||
module I = struct
|
module I = struct
|
||||||
|
|
||||||
let default_max_endorsement_priority ctxt arg =
|
let default_max_endorsement_priority ctxt arg =
|
||||||
let default = Constants.max_signing_slot ctxt in
|
let default = Constants.endorsers_per_block ctxt in
|
||||||
match arg with
|
match arg with
|
||||||
| None -> default
|
| None -> default
|
||||||
| Some m -> m
|
| Some m -> m
|
||||||
|
@ -88,13 +88,13 @@ module Constants = struct
|
|||||||
~output: (obj1 (req "first_free_baking_slot" uint16))
|
~output: (obj1 (req "first_free_baking_slot" uint16))
|
||||||
RPC_path.(custom_root / "constants" / "first_free_baking_slot")
|
RPC_path.(custom_root / "constants" / "first_free_baking_slot")
|
||||||
|
|
||||||
let max_signing_slot custom_root =
|
let endorsers_per_block custom_root =
|
||||||
RPC_service.post_service
|
RPC_service.post_service
|
||||||
~description: "Max signing slot"
|
~description: "Max signing slot"
|
||||||
~query: RPC_query.empty
|
~query: RPC_query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "max_signing_slot" uint16))
|
~output: (obj1 (req "endorsers_per_block" uint16))
|
||||||
RPC_path.(custom_root / "constants" / "max_signing_slot")
|
RPC_path.(custom_root / "constants" / "endorsers_per_block")
|
||||||
|
|
||||||
let max_gas custom_root =
|
let max_gas custom_root =
|
||||||
RPC_service.post_service
|
RPC_service.post_service
|
||||||
|
Loading…
Reference in New Issue
Block a user