Verified Commit 6909f0b3 authored by Vincent Botbol's avatar Vincent Botbol Committed by Grégoire Henry

Shell: benchmark for the context storage

Co-authored-by: 's avatarQuyen <kim.quyen.ly@tezos.com>
Co-authored-by: Grégoire Henry's avatarGrégoire Henry <gregoire.henry@tezos.com>
Signed-off-by: Grégoire Henry's avatarGrégoire Henry <gregoire.henry@tezos.com>
parent f1dce568
Pipeline #25581511 failed with stages
in 12 minutes and 51 seconds
......@@ -323,190 +323,197 @@ opam:25:tezos-protocol-environment-sigs:
variables:
package: tezos-protocol-environment-sigs
opam:26:tezos-client-base:
opam:26:ledgerwallet:
<<: *opam_definition
variables:
package: ledgerwallet
opam:27:tezos-client-base:
<<: *opam_definition
variables:
package: tezos-client-base
opam:27:tezos-protocol-compiler:
opam:28:tezos-protocol-compiler:
<<: *opam_definition
variables:
package: tezos-protocol-compiler
opam:28:tezos-signer-services:
opam:29:ledgerwallet-tezos:
<<: *opam_definition
variables:
package: ledgerwallet-tezos
opam:30:tezos-signer-services:
<<: *opam_definition
variables:
package: tezos-signer-services
opam:29:tezos-protocol-alpha:
opam:31:tezos-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-protocol-alpha
opam:30:tezos-protocol-environment:
opam:32:tezos-protocol-environment:
<<: *opam_definition
variables:
package: tezos-protocol-environment
opam:31:tezos-signer-backends:
opam:33:tezos-signer-backends:
<<: *opam_definition
variables:
package: tezos-signer-backends
opam:32:tezos-client-alpha:
opam:34:tezos-client-alpha:
<<: *opam_definition
variables:
package: tezos-client-alpha
opam:33:tezos-client-commands:
opam:35:tezos-client-commands:
<<: *opam_definition
variables:
package: tezos-client-commands
opam:34:tezos-protocol-environment-shell:
opam:36:tezos-protocol-environment-shell:
<<: *opam_definition
variables:
package: tezos-protocol-environment-shell
opam:35:tezos-baking-alpha:
opam:37:tezos-baking-alpha:
<<: *opam_definition
variables:
package: tezos-baking-alpha
opam:36:tezos-protocol-genesis:
opam:38:tezos-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-protocol-genesis
opam:37:ocplib-resto-json:
opam:39:ocplib-resto-json:
<<: *opam_definition
variables:
package: ocplib-resto-json
opam:38:tezos-protocol-updater:
opam:40:tezos-protocol-updater:
<<: *opam_definition
variables:
package: tezos-protocol-updater
opam:39:tezos-p2p:
opam:41:tezos-p2p:
<<: *opam_definition
variables:
package: tezos-p2p
opam:40:tezos-baking-alpha-commands:
opam:42:tezos-baking-alpha-commands:
<<: *opam_definition
variables:
package: tezos-baking-alpha-commands
opam:41:tezos-client-alpha-commands:
opam:43:tezos-client-alpha-commands:
<<: *opam_definition
variables:
package: tezos-client-alpha-commands
opam:42:tezos-client-base-unix:
opam:44:tezos-client-base-unix:
<<: *opam_definition
variables:
package: tezos-client-base-unix
opam:43:tezos-client-genesis:
opam:45:tezos-client-genesis:
<<: *opam_definition
variables:
package: tezos-client-genesis
opam:44:ocplib-ezresto:
opam:46:ocplib-ezresto:
<<: *opam_definition
variables:
package: ocplib-ezresto
opam:45:ledgerwallet:
<<: *opam_definition
variables:
package: ledgerwallet
opam:46:tezos-embedded-protocol-alpha:
opam:47:tezos-embedded-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-alpha
opam:47:tezos-embedded-protocol-demo:
opam:48:tezos-embedded-protocol-demo:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-demo
opam:48:tezos-embedded-protocol-genesis:
opam:49:tezos-embedded-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-genesis
opam:49:tezos-shell:
opam:50:tezos-shell:
<<: *opam_definition
variables:
package: tezos-shell
opam:50:tezos-endorser-alpha-commands:
opam:51:tezos-endorser-alpha-commands:
<<: *opam_definition
variables:
package: tezos-endorser-alpha-commands
opam:51:tezos-client:
opam:52:tezos-client:
<<: *opam_definition
variables:
package: tezos-client
opam:52:tezos-endorser-alpha:
opam:53:ocplib-ezresto-directory:
<<: *opam_definition
variables:
package: tezos-endorser-alpha
package: ocplib-ezresto-directory
opam:53:tezos-accuser-alpha-commands:
opam:54:tezos-accuser-alpha:
<<: *opam_definition
variables:
package: tezos-accuser-alpha-commands
package: tezos-accuser-alpha
opam:54:ocplib-ezresto-directory:
opam:55:tezos-endorser-alpha:
<<: *opam_definition
variables:
package: ocplib-ezresto-directory
package: tezos-endorser-alpha
opam:55:tezos-accuser-alpha:
opam:56:tezos-accuser-alpha-commands:
<<: *opam_definition
variables:
package: tezos-accuser-alpha
package: tezos-accuser-alpha-commands
opam:56:tezos-baker-alpha:
opam:57:tezos-baker-alpha:
<<: *opam_definition
variables:
package: tezos-baker-alpha
opam:57:tezos-protocol-demo:
opam:58:tezos-protocol-demo:
<<: *opam_definition
variables:
package: tezos-protocol-demo
opam:58:tezos-signer:
opam:59:tezos-signer:
<<: *opam_definition
variables:
package: tezos-signer
opam:59:ledgerwallet-tezos:
<<: *opam_definition
variables:
package: ledgerwallet-tezos
opam:60:tezos-node:
<<: *opam_definition
variables:
package: tezos-node
opam:59:ocplib-json-typed-browser:
opam:61:ocplib-json-typed-browser:
<<: *opam_definition
variables:
package: ocplib-json-typed-browser
opam:60:tezos-baker-alpha-commands:
opam:62:tezos-baker-alpha-commands:
<<: *opam_definition
variables:
package: tezos-baker-alpha-commands
opam:63:tezos-bench:
<<: *opam_definition
variables:
package: tezos-bench
##END_OPAM##
......
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
let make_simple blocks =
let rec loop pred n =
if n <= 0 then
return pred
else
Block.bake pred >>=? fun block ->
loop block (n - 1) in
Context.init 5 >>=? fun (genesis, _) ->
loop genesis blocks
type args = {
blocks : int ;
accounts : int ;
}
let default_args = {
blocks = 1000 ;
accounts = 5 ;
}
let set_blocks cf blocks =
cf := { !cf with blocks }
let set_accounts cf accounts =
cf := { !cf with accounts }
let read_args () =
let args = ref default_args in
let specific =
[
("--blocks", Arg.Int (set_blocks args), "number of blocks");
("--accounts", Arg.Int (set_accounts args), "number of acount");
]
in
let usage = "Usage: [--blocks n] [--accounts n] " in
Arg.parse specific (fun _ -> ()) usage ;
!args
let () =
let args = read_args () in
match Lwt_main.run (make_simple args.blocks) with
| Ok _head ->
Format.printf "Success.@." ;
exit 0
| Error err ->
Format.eprintf "%a@." pp_print_error err ;
exit 1
This diff is collapsed.
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
open Proto_alpha
type t = {
pkh : Signature.Public_key_hash.t ;
pk : Signature.Public_key.t ;
sk : Signature.Secret_key.t ;
}
type account = t
let commitment_secret =
Proto_alpha.Blinded_public_key_hash.activation_code_of_hex
"aaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb"
let known_accounts = Signature.Public_key_hash.Table.create 17
let new_account ?seed () =
let (pkh, pk, sk) = Signature.generate_key ?seed ~algo:Ed25519 () in
let account = { pkh ; pk ; sk } in
Signature.Public_key_hash.Table.add known_accounts pkh account ;
account
let add_account ({ pkh ; _ } as account) =
Signature.Public_key_hash.Table.add known_accounts pkh account
let dictator_account = new_account ()
let find pkh =
try return (Signature.Public_key_hash.Table.find known_accounts pkh)
with Not_found ->
failwith "Missing account: %a" Signature.Public_key_hash.pp pkh
let find_alternate pkh =
let exception Found of t in
try
Signature.Public_key_hash.Table.iter
(fun pkh' account ->
if not (Signature.Public_key_hash.equal pkh pkh') then
raise (Found account))
known_accounts ;
raise Not_found
with Found account -> account
let dummy_account = new_account ()
let new_commitment ?seed () =
let (pkh, pk, sk) = Signature.generate_key ?seed ~algo:Ed25519 () in
let unactivated_account = { pkh; pk; sk } in
let open Proto_alpha in
let open Commitment_repr in
let pkh = match pkh with Ed25519 pkh -> pkh | _ -> assert false in
let bpkh = Blinded_public_key_hash.of_ed25519_pkh commitment_secret pkh in
Lwt.return @@ Alpha_environment.wrap_error @@
Tez_repr.(one *? 4_000L) >>=? fun amount ->
return @@ (unactivated_account, { blinded_public_key_hash = bpkh ; amount })
let generate_accounts n : (t * Tez_repr.t) list =
Signature.Public_key_hash.Table.clear known_accounts ;
let amount = Tez_repr.of_mutez_exn 4_000_000_000_000L in
List.map (fun _ ->
let (pkh, pk, sk) = Signature.generate_key () in
let account = { pkh ; pk ; sk } in
Signature.Public_key_hash.Table.add known_accounts pkh account ;
account, amount)
(0--(n-1))
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
open Proto_alpha
type t = {
pkh : Signature.Public_key_hash.t ;
pk : Signature.Public_key.t ;
sk : Signature.Secret_key.t ;
}
type account = t
val commitment_secret : Blinded_public_key_hash.activation_code
val dictator_account: account
val dummy_account: account
val new_account: ?seed : MBytes.t -> unit -> account
val new_commitment : ?seed:MBytes.t -> unit ->
(account * Commitment_repr.t) tzresult Lwt.t
val add_account : t -> unit
val known_accounts : t Signature.Public_key_hash.Table.t
val find: Signature.Public_key_hash.t -> t tzresult Lwt.t
val find_alternate: Signature.Public_key_hash.t -> t
(** [generate_accounts n] : generates [n] random accounts with
4.000.000.000 tz and add them to the global account state *)
val generate_accounts : int -> (t * Tez_repr.t) list
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
open Proto_alpha
let error ~loc v f =
match v with
| Error err when List.exists f err ->
return ()
| Ok _ ->
failwith "Unexpected successful result (%s)" loc
| Error err ->
failwith "@[Unexpected error (%s): %a@]" loc pp_print_error err
let proto_error ~loc v f =
error ~loc v
(function
| Alpha_environment.Ecoproto_error err -> f err
| _ -> false)
let equal ~loc (cmp : 'a -> 'a -> bool) msg pp a b =
if not (cmp a b) then
failwith "@[@[[%s]@] - @[%s : %a is not equal to %a@]@]" loc msg pp a pp b
else
return ()
let not_equal ~loc (cmp : 'a -> 'a -> bool) msg pp a b =
if cmp a b then
failwith "@[@[[%s]@] - @[%s : %a is equal to %a@]@]" loc msg pp a pp b
else
return ()
let equal_tez ~loc (a:Alpha_context.Tez.t) (b:Alpha_context.Tez.t) =
let open Alpha_context in
equal ~loc Tez.(=) "Tez aren't equal" Tez.pp a b
let not_equal_tez ~loc (a:Alpha_context.Tez.t) (b:Alpha_context.Tez.t) =
let open Alpha_context in
not_equal ~loc Tez.(=) "Tez are equal" Tez.pp a b
let equal_int ~loc (a:int) (b:int) =
equal ~loc (=) "Integers aren't equal" Format.pp_print_int a b
let not_equal_int ~loc (a:int) (b:int) =
not_equal ~loc (=) "Integers are equal" Format.pp_print_int a b
let equal_bool ~loc (a:bool) (b:bool) =
equal ~loc (=) "Booleans aren't equal" Format.pp_print_bool a b
let not_equal_bool ~loc (a:bool) (b:bool) =
not_equal ~loc (=) "Booleans are equal" Format.pp_print_bool a b
open Context
(* Some asserts for account operations *)
(** [balance_is b c amount] checks that the current balance of contract [c] is
[amount].
Default balance type is [Main], pass [~kind] with [Deposit], [Fees] or
[Rewards] for the others. *)
let balance_is ~loc b contract ?(kind = Contract.Main) expected =
Contract.balance b contract ~kind >>=? fun balance ->
equal_tez ~loc balance expected
(** [balance_was_operated ~operand b c old_balance amount] checks that the
current balance of contract [c] is [operand old_balance amount] and
returns the current balance.
Default balance type is [Main], pass [~kind] with [Deposit], [Fees] or
[Rewards] for the others. *)
let balance_was_operated ~(operand) ~loc b contract ?(kind = Contract.Main) old_balance amount =
operand old_balance amount |>
Alpha_environment.wrap_error |> Lwt.return >>=? fun expected ->
balance_is ~loc b contract ~kind expected
let balance_was_credited = balance_was_operated ~operand:Alpha_context.Tez.(+?)
let balance_was_debited = balance_was_operated ~operand:Alpha_context.Tez.(-?)
(* debug *)
let print_balances ctxt id =
Contract.balance ~kind:Main ctxt id >>=? fun main ->
Contract.balance ~kind:Deposit ctxt id >>=? fun deposit ->
Contract.balance ~kind:Fees ctxt id >>=? fun fees ->
Contract.balance ~kind:Rewards ctxt id >>|? fun rewards ->
Format.printf "\nMain: %s\nDeposit: %s\nFees: %s\nRewards: %s\n"
(Alpha_context.Tez.to_string main)
(Alpha_context.Tez.to_string deposit)
(Alpha_context.Tez.to_string fees)
(Alpha_context.Tez.to_string rewards)
This diff is collapsed.
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
open Proto_alpha
open Alpha_context
type t = {
hash : Block_hash.t ;
header : Block_header.t ;
operations : Operation.packed list ;
context : Tezos_protocol_environment_memory.Context.t ; (** Resulting context *)
}
type block = t
val rpc_ctxt: t Alpha_environment.RPC_context.simple
(** Policies to select the next baker:
- [By_priority p] selects the baker at priority [p]
- [By_account pkh] selects the first slot for baker [pkh]
- [Excluding pkhs] selects the first baker that doesn't belong to [pkhs]
*)
type baker_policy =
| By_priority of int
| By_account of public_key_hash
| Excluding of public_key_hash list
(** Returns (account, priority, timestamp) of the next baker given
a policy, defaults to By_priority 0. *)
val get_next_baker:
?policy:baker_policy ->
t -> (public_key_hash * int * Time.t) tzresult Lwt.t
module Forge : sig
val contents:
?proof_of_work_nonce:MBytes.t ->
?priority:int ->
?seed_nonce_hash: Nonce_hash.t ->
unit -> Block_header.contents
type header
(** Forges a correct header following the policy.
The header can then be modified and applied with [apply]. *)
val forge_header:
?policy:baker_policy ->
?operations: Operation.packed list ->
t -> header tzresult Lwt.t
(** Sets uniquely seed_nonce_hash of a header *)
val set_seed_nonce_hash:
Nonce_hash.t option -> header -> header
(** Sets the baker that will sign the header to an arbitrary pkh *)
val set_baker:
public_key_hash -> header -> header
(** Signs the header with the key of the baker configured in the header.
The header can no longer be modified, only applied. *)
val sign_header:
header ->
Block_header.block_header tzresult Lwt.t
end
val genesis_with_parameters :
Constants_repr.parametric ->
?commitments: Commitment_repr.t list ->
?security_deposit_ramp_up_cycles:int option ->
?no_reward_cycles:int option ->
(Account.t * Proto_alpha.Tez_repr.t) list -> block tzresult Lwt.t
(** [genesis <opts> accounts] : generates an initial block with the
given constants [<opts>] and initializes [accounts] with their
associated amounts.
*)
val genesis:
?preserved_cycles:int ->
?blocks_per_cycle:int32 ->
?blocks_per_commitment:int32 ->
?blocks_per_roll_snapshot:int32 ->
?blocks_per_voting_period:int32 ->
?time_between_blocks:Period_repr.t list ->
?endorsers_per_block:int ->
?hard_gas_limit_per_operation:Z.t ->
?hard_gas_limit_per_block:Z.t ->
?proof_of_work_threshold:int64 ->
?tokens_per_roll:Tez_repr.tez ->
?michelson_maximum_type_size:int ->
?seed_nonce_revelation_tip:Tez_repr.tez ->
?origination_burn:Tez_repr.tez ->
?block_security_deposit:Tez_repr.tez ->
?endorsement_security_deposit:Tez_repr.tez ->
?block_reward:Tez_repr.tez ->
?endorsement_reward:Tez_repr.tez ->
?cost_per_byte: Tez_repr.t ->
?hard_storage_limit_per_operation: Z.t ->
(Account.t * Tez_repr.tez) list -> block tzresult Lwt.t
(** Applies a signed header and its operations to a block and
obtains a new block *)
val apply:
Block_header.block_header ->
?operations: Operation.packed list ->
t -> t tzresult Lwt.t
(**
[bake b] returns a block [b'] which has as predecessor block [b].
Optional parameter [policy] allows to pick the next baker in several ways.
This function bundles together [forge_header], [sign_header] and [apply].