Alpha: adjust constants

This commit is contained in:
Grégoire Henry 2018-03-15 14:47:48 +01:00 committed by Benjamin Canou
parent abe769c393
commit dc681551e6
6 changed files with 13 additions and 47 deletions

View File

@ -269,7 +269,6 @@ module Constants : sig
val blocks_per_commitment: context -> int32 val blocks_per_commitment: context -> int32
val block_per_roll_snapshot: context -> int32 val block_per_roll_snapshot: context -> int32
val voting_period_length: context -> int32 val voting_period_length: context -> int32
val time_before_reward: context -> Period.t
val slot_durations: context -> Period.t list val slot_durations: 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 max_signing_slot: context -> int
@ -279,6 +278,7 @@ module Constants : sig
val max_number_of_operations: context -> int list val max_number_of_operations: context -> int list
val max_operation_data_length: context -> int val max_operation_data_length: context -> int
val michelson_maximum_type_size: context -> int val michelson_maximum_type_size: context -> int
end end
module Voting_period : sig module Voting_period : sig

View File

@ -20,21 +20,21 @@ let seed_nonce_revelation_tip =
let origination_burn = let origination_burn =
Tez_repr.one Tez_repr.one
(* 1000 tez *) (* 512 tez *)
let baking_bond_cost = let baking_bond_cost =
Tez_repr.(mul_exn one 1000) Tez_repr.(mul_exn one 512)
(* 1000 tez *) (* 64 tez *)
let endorsement_bond_cost = let endorsement_bond_cost =
Tez_repr.(mul_exn one 1000) Tez_repr.(mul_exn one 64)
(* 150 tez *) (* 16 tez *)
let baking_reward = let baking_reward =
Tez_repr.(mul_exn one 150) Tez_repr.(mul_exn one 16)
(* 150 tez *) (* 2 tez *)
let endorsement_reward = let endorsement_reward =
Tez_repr.(mul_exn one 150) Tez_repr.(mul_exn one 2)
(* 100,000 tez *) (* 100,000 tez *)
let faucet_credit = let faucet_credit =
@ -50,7 +50,6 @@ type constants = {
blocks_per_commitment: int32 ; blocks_per_commitment: int32 ;
block_per_roll_snapshot: int32 ; block_per_roll_snapshot: int32 ;
voting_period_length: int32 ; voting_period_length: int32 ;
time_before_reward: Period_repr.t ;
slot_durations: Period_repr.t list ; slot_durations: Period_repr.t list ;
first_free_baking_slot: int ; first_free_baking_slot: int ;
max_signing_slot: int ; max_signing_slot: int ;
@ -68,18 +67,14 @@ let read_public_key s = Ed25519.Public_key.of_hex_exn (`Hex s)
let default = { let default = {
preserved_cycles = 5 ; preserved_cycles = 5 ;
cycle_length = 2048l ; cycle_length = 4096l ;
blocks_per_commitment = 32l ; blocks_per_commitment = 32l ;
block_per_roll_snapshot = 256l ; block_per_roll_snapshot = 256l ;
voting_period_length = 32768l ; voting_period_length = 32768l ;
time_before_reward =
Period_repr.of_seconds_exn
(* One year in seconds *)
Int64.(mul 365L (mul 24L 3600L)) ;
slot_durations = slot_durations =
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 = 15 ; max_signing_slot = 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) ;
@ -133,10 +128,6 @@ let constants_encoding =
and voting_period_length = and voting_period_length =
opt Compare.Int32.(=) opt Compare.Int32.(=)
default.voting_period_length c.voting_period_length default.voting_period_length c.voting_period_length
and time_before_reward =
map_option Period_repr.to_seconds @@
opt Period_repr.(=)
default.time_before_reward c.time_before_reward
and slot_durations = and slot_durations =
opt Compare_slot_durations.(=) opt Compare_slot_durations.(=)
default.slot_durations c.slot_durations default.slot_durations c.slot_durations
@ -176,7 +167,6 @@ let constants_encoding =
blocks_per_commitment, blocks_per_commitment,
block_per_roll_snapshot, block_per_roll_snapshot,
voting_period_length, voting_period_length,
time_before_reward,
slot_durations, slot_durations,
first_free_baking_slot, first_free_baking_slot,
max_signing_slot, max_signing_slot,
@ -193,7 +183,6 @@ let constants_encoding =
blocks_per_commitment, blocks_per_commitment,
block_per_roll_snapshot, block_per_roll_snapshot,
voting_period_length, voting_period_length,
time_before_reward,
slot_durations, slot_durations,
first_free_baking_slot, first_free_baking_slot,
max_signing_slot, max_signing_slot,
@ -215,9 +204,6 @@ let constants_encoding =
unopt default.block_per_roll_snapshot block_per_roll_snapshot ; unopt default.block_per_roll_snapshot block_per_roll_snapshot ;
voting_period_length = voting_period_length =
unopt default.voting_period_length voting_period_length ; unopt default.voting_period_length voting_period_length ;
time_before_reward =
unopt default.time_before_reward @@
map_option Period_repr.of_seconds_exn time_before_reward ;
slot_durations = slot_durations =
unopt default.slot_durations @@ unopt default.slot_durations @@
slot_durations ; slot_durations ;
@ -245,13 +231,12 @@ let constants_encoding =
Data_encoding.( Data_encoding.(
merge_objs merge_objs
(merge_objs (merge_objs
(obj10 (obj9
(opt "preserved_cycles" uint8) (opt "preserved_cycles" uint8)
(opt "cycle_length" int32) (opt "cycle_length" int32)
(opt "blocks_per_commitment" int32) (opt "blocks_per_commitment" int32)
(opt "block_per_roll_snapshot" int32) (opt "block_per_roll_snapshot" int32)
(opt "voting_period_length" int32) (opt "voting_period_length" int32)
(opt "time_before_reward" int64)
(opt "slot_durations" (list Period_repr.encoding)) (opt "slot_durations" (list Period_repr.encoding))
(opt "first_free_baking_slot" uint16) (opt "first_free_baking_slot" uint16)
(opt "max_signing_slot" uint16) (opt "max_signing_slot" uint16)

View File

@ -56,14 +56,6 @@ module S = struct
~output: (obj1 (req "block_per_roll_snapshot" int32)) ~output: (obj1 (req "block_per_roll_snapshot" int32))
RPC_path.(custom_root / "block_per_roll_snapshot") RPC_path.(custom_root / "block_per_roll_snapshot")
let time_before_reward =
RPC_service.post_service
~description: "Time before reward"
~query: RPC_query.empty
~input: empty
~output: (obj1 (req "time_before_reward" Period.encoding))
RPC_path.(custom_root / "time_before_reward")
let slot_durations = let slot_durations =
RPC_service.post_service RPC_service.post_service
~description: "Slot durations" ~description: "Slot durations"
@ -132,9 +124,6 @@ let () =
register0 S.block_per_roll_snapshot begin fun ctxt () () -> register0 S.block_per_roll_snapshot begin fun ctxt () () ->
return (Constants.block_per_roll_snapshot ctxt) return (Constants.block_per_roll_snapshot ctxt)
end ; end ;
register0 S.time_before_reward begin fun ctxt () () ->
return (Constants.time_before_reward ctxt)
end ;
register0 S.slot_durations begin fun ctxt () () -> register0 S.slot_durations begin fun ctxt () () ->
return (Constants.slot_durations ctxt) return (Constants.slot_durations ctxt)
end ; end ;
@ -164,8 +153,6 @@ let blocks_per_commitment ctxt block =
RPC_context.make_call0 S.blocks_per_commitment ctxt block () () RPC_context.make_call0 S.blocks_per_commitment ctxt block () ()
let block_per_roll_snapshot ctxt block = let block_per_roll_snapshot ctxt block =
RPC_context.make_call0 S.block_per_roll_snapshot ctxt block () () RPC_context.make_call0 S.block_per_roll_snapshot ctxt block () ()
let time_before_reward ctxt block =
RPC_context.make_call0 S.time_before_reward ctxt block () ()
let slot_durations ctxt block = let slot_durations ctxt block =
RPC_context.make_call0 S.slot_durations ctxt block () () RPC_context.make_call0 S.slot_durations ctxt block () ()
let first_free_baking_slot ctxt block = let first_free_baking_slot ctxt block =

View File

@ -24,9 +24,6 @@ val blocks_per_commitment:
val block_per_roll_snapshot: val block_per_roll_snapshot:
'a #RPC_context.simple -> 'a -> int32 shell_tzresult Lwt.t 'a #RPC_context.simple -> 'a -> int32 shell_tzresult Lwt.t
val time_before_reward:
'a #RPC_context.simple -> 'a -> Period.t shell_tzresult Lwt.t
val slot_durations: val slot_durations:
'a #RPC_context.simple -> 'a -> Period.t list shell_tzresult Lwt.t 'a #RPC_context.simple -> 'a -> Period.t list shell_tzresult Lwt.t

View File

@ -22,9 +22,6 @@ let block_per_roll_snapshot c =
let voting_period_length c = let voting_period_length c =
let constants = Raw_context.constants c in let constants = Raw_context.constants c in
constants.voting_period_length constants.voting_period_length
let time_before_reward c =
let constants = Raw_context.constants c in
constants.time_before_reward
let slot_durations c = let slot_durations c =
let constants = Raw_context.constants c in let constants = Raw_context.constants c in
constants.slot_durations constants.slot_durations

View File

@ -21,7 +21,7 @@ let validation_passes =
Updater.[ { max_size = 32 * 1024 ; max_op = Some 32 } ; (* 32kB FIXME *) Updater.[ { max_size = 32 * 1024 ; max_op = Some 32 } ; (* 32kB FIXME *)
{ max_size = 32 * 1024 ; max_op = None } ; (* 32kB FIXME *) { max_size = 32 * 1024 ; max_op = None } ; (* 32kB FIXME *)
{ max_size = 32 * 1024 ; max_op = Some 32 } ; (* 32kB FIXME *) { max_size = 32 * 1024 ; max_op = Some 32 } ; (* 32kB FIXME *)
{ max_size = 1024 * 1024 ; max_op = None } ] (* 1MB *) { max_size = 512 * 1024 ; max_op = None } ] (* 512kB *)
let rpc_services = Services_registration.get_rpc_services () let rpc_services = Services_registration.get_rpc_services ()