text stringlengths 12 786k |
|---|
module type ITER_SEQUENTIAL = sig include ITER_VANILLA val iter_e : ( ' a elt -> ( unit , ' trace ) result ) -> ' a t -> ( unit , ' trace ) result val iter_s : ( ' a elt -> unit Lwt . t ) -> ' a t -> unit Lwt . t val iter_es : ( ' a elt -> ( unit , ' trace ) re... |
module type ITER_PARALLEL = sig include ITER_SEQUENTIAL val iter_p : ( ' a elt -> unit Lwt . t ) -> ' a t -> unit Lwt . t val iter_ep : ( ' a elt -> ( unit , ' error trace ) result Lwt . t ) -> ' a t -> ( unit , ' error trace ) result Lwt . t end |
module type ITERI_VANILLA = sig type ' a elt type ' a t val iteri : ( int -> ' a elt -> unit ) -> ' a t -> unit end |
module type ITERI_SEQUENTIAL = sig include ITERI_VANILLA val iteri_e : ( int -> ' a elt -> ( unit , ' trace ) result ) -> ' a t -> ( unit , ' trace ) result val iteri_s : ( int -> ' a elt -> unit Lwt . t ) -> ' a t -> unit Lwt . t val iteri_es : ( int -> ' a elt -> ... |
module type MAP_VANILLA = sig type ' a t val map : ( ' a -> ' b ) -> ' a t -> ' b t end |
module type MAP_SEQUENTIAL = sig include MAP_VANILLA val map_e : ( ' a -> ( ' b , ' trace ) result ) -> ' a t -> ( ' b t , ' trace ) result val map_s : ( ' a -> ' b Lwt . t ) -> ' a t -> ' b t Lwt . t val map_es : ( ' a -> ( ' b , ' trace ) result Lwt... |
module type MAP_PARALLEL = sig include MAP_SEQUENTIAL val map_p : ( ' a -> ' b Lwt . t ) -> ' a t -> ' b t Lwt . t val map_ep : ( ' a -> ( ' b , ' error trace ) result Lwt . t ) -> ' a t -> ( ' b t , ' error trace ) result Lwt . t end |
module type REVMAP_VANILLA = sig type ' a t val rev : ' a t -> ' a t val rev_map : ( ' a -> ' b ) -> ' a t -> ' b t end |
module type REVMAP_SEQUENTIAL = sig include REVMAP_VANILLA val rev_map_e : ( ' a -> ( ' b , ' trace ) result ) -> ' a t -> ( ' b t , ' trace ) result val rev_map_s : ( ' a -> ' b Lwt . t ) -> ' a t -> ' b t Lwt . t val rev_map_es : ( ' a -> ( ' b , ' tr... |
module type REVMAP_PARALLEL = sig include REVMAP_SEQUENTIAL val rev_map_p : ( ' a -> ' b Lwt . t ) -> ' a t -> ' b t Lwt . t val rev_map_ep : ( ' a -> ( ' b , ' error trace ) result Lwt . t ) -> ' a t -> ( ' b t , ' error trace ) result Lwt . t end |
module type FOLDLEFT_VANILLA = sig type ' a elt type ' a t val fold_left : ( ' a -> ' b elt -> ' a ) -> ' a -> ' b t -> ' a end |
module type FOLDLEFT_SEQUENTIAL = sig include FOLDLEFT_VANILLA val fold_left_e : ( ' a -> ' b elt -> ( ' a , ' trace ) result ) -> ' a -> ' b t -> ( ' a , ' trace ) result val fold_left_s : ( ' a -> ' b elt -> ' a Lwt . t ) -> ' a -> ' b t -> ' a Lwt . t ... |
module type FOLDRIGHT_VANILLA = sig type ' a t val fold_right : ( ' a -> ' b -> ' b ) -> ' a t -> ' b -> ' b end |
module type FOLDRIGHT_SEQUENTIAL = sig include FOLDRIGHT_VANILLA val fold_right_e : ( ' a -> ' b -> ( ' b , ' trace ) result ) -> ' a t -> ' b -> ( ' b , ' trace ) result val fold_right_s : ( ' a -> ' b -> ' b Lwt . t ) -> ' a t -> ' b -> ' b Lwt . t val ... |
module type FOLDOOO_VANILLA = sig type ' a elt type ' a t val fold : ( ' b elt -> ' a -> ' a ) -> ' b t -> ' a -> ' a end |
module type FOLDOOO_SEQUENTIAL = sig include FOLDOOO_VANILLA val fold_e : ( ' b elt -> ' a -> ( ' a , ' trace ) result ) -> ' b t -> ' a -> ( ' a , ' trace ) result val fold_s : ( ' b elt -> ' a -> ' a Lwt . t ) -> ' b t -> ' a -> ' a Lwt . t val fold_es ... |
module type EXISTFORALL_VANILLA = sig type ' a elt type ' a t val exists : ( ' a elt -> bool ) -> ' a t -> bool val for_all : ( ' a elt -> bool ) -> ' a t -> bool end |
module type EXISTFORALL_SEQUENTIAL = sig include EXISTFORALL_VANILLA val exists_e : ( ' a elt -> ( bool , ' trace ) result ) -> ' a t -> ( bool , ' trace ) result val exists_s : ( ' a elt -> bool Lwt . t ) -> ' a t -> bool Lwt . t val exists_es : ( ' a elt -> ( bool ... |
module type EXISTFORALL_PARALLEL = sig include EXISTFORALL_SEQUENTIAL val exists_p : ( ' a elt -> bool Lwt . t ) -> ' a t -> bool Lwt . t val exists_ep : ( ' a elt -> ( bool , ' error trace ) result Lwt . t ) -> ' a t -> ( bool , ' error trace ) result Lwt . t val for_al... |
module type FILTER_VANILLA = sig type ' a elt type ' a t val filter : ( ' a -> bool ) -> ' a t -> ' a t end |
module type FILTER_SEQUENTIAL = sig include FILTER_VANILLA val filter_e : ( ' a -> ( bool , ' trace ) result ) -> ' a t -> ( ' a t , ' trace ) result val filter_s : ( ' a -> bool Lwt . t ) -> ' a t -> ' a t Lwt . t val filter_es : ( ' a -> ( bool , ' trace ) ... |
module type FILTER_PARALLEL = sig type ' a t val filter_p : ( ' a -> bool Lwt . t ) -> ' a t -> ' a t Lwt . t val filter_ep : ( ' a -> ( bool , ' error trace ) result Lwt . t ) -> ' a t -> ( ' a t , ' error trace ) result Lwt . t end |
module type FILTERMAP_VANILLA = sig type ' a t val filter_map : ( ' a -> ' b option ) -> ' a t -> ' b t end |
module type FILTERMAP_SEQUENTIAL = sig include FILTERMAP_VANILLA val filter_map_e : ( ' a -> ( ' b option , ' trace ) result ) -> ' a t -> ( ' b t , ' trace ) result val filter_map_s : ( ' a -> ' b option Lwt . t ) -> ' a t -> ' b t Lwt . t val filter_map_es : ( '... |
module type FILTERMAP_PARALLEL = sig type ' a t val filter_map_p : ( ' a -> ' b option Lwt . t ) -> ' a t -> ' b t Lwt . t val filter_map_ep : ( ' a -> ( ' b option , ' error trace ) result Lwt . t ) -> ' a t -> ( ' b t , ' error trace ) result Lwt . t end |
module type FIND_VANILLA = sig type ' a t val find : ( ' a -> bool ) -> ' a t -> ' a option end |
module type FIND_SEQUENTIAL = sig include FIND_VANILLA val find_e : ( ' a -> ( bool , ' trace ) result ) -> ' a t -> ( ' a option , ' trace ) result val find_s : ( ' a -> bool Lwt . t ) -> ' a t -> ' a option Lwt . t val find_es : ( ' a -> ( bool , ' trace ) ... |
module type PARTITION_VANILLA = sig type ' a t val partition : ( ' a -> bool ) -> ' a t -> ' a t * ' a t end |
module type PARTITION_SEQUENTIAL = sig include PARTITION_VANILLA val partition_e : ( ' a -> ( bool , ' trace ) result ) -> ' a t -> ( ' a t * ' a t , ' trace ) result val partition_s : ( ' a -> bool Lwt . t ) -> ' a t -> ( ' a t * ' a t ) Lwt . t val partition_... |
module type PARTITION_PARALLEL = sig include PARTITION_SEQUENTIAL val partition_p : ( ' a -> bool Lwt . t ) -> ' a t -> ( ' a t * ' a t ) Lwt . t val partition_ep : ( ' a -> ( bool , ' error trace ) result Lwt . t ) -> ' a t -> ( ' a t * ' a t , ' error trace )... |
module type COMBINE_VANILLA = sig type ' a t val combine : when_different_lengths ' : trace -> ' a t -> ' b t -> ( ( ' a * ' b ) t , ' trace ) result val combine_with_leftovers : ' a t -> ' b t -> ( ' a * ' b ) t * ( ' a list , ' b list ) Either . t option end |
module type ALLDOUBLE_VANILLA = sig type ' a t val iter2 : when_different_lengths ' : trace -> ( ' a -> ' b -> unit ) -> ' a t -> ' b t -> ( unit , ' trace ) result val map2 : when_different_lengths ' : trace -> ( ' a -> ' b -> ' c ) -> ' a t -> ' b t -> ( ' ... |
module type ALLDOUBLE_SEQENTIAL = sig include ALLDOUBLE_VANILLA val iter2_e : when_different_lengths ' : trace -> ( ' a -> ' b -> ( unit , ' trace ) result ) -> ' a t -> ' b t -> ( unit , ' trace ) result val iter2_s : when_different_lengths ' : trace -> ( ' a -> ' b ... |
let debug fmt = Logging . debug " transaction " fmt |
let test_eagain = ref false |
let check_parents_perms_identical root1 root2 path = |
let get_lowest path1 path2 = |
let test_coalesce oldroot currentroot path = false ) ) false |
let can_coalesce oldroot currentroot path = |
type ty = No | Full of ( int32 * Store . Node . t * Store . t ) |
type t = { } |
let make id store = { } |
let get_id t = match t . ty with No -> none | Full ( id , _ , _ ) -> id |
let get_store t = t . store |
let get_paths t = t . paths |
let add_wop t ty path = t . paths <- ( ty , Store . Path . to_name path ) :: t . paths |
let add_operation t request response = t . operations <- ( request , response ) :: t . operations |
let get_operations t = List . rev t . operations |
let set_read_lowpath t path = t . read_lowpath <- get_lowest path t . read_lowpath |
let set_write_lowpath t path = t . write_lowpath <- get_lowest path t . write_lowpath |
let exists t perms path = Store . exists t . store path |
let write t creator perm path value = |
let mkdir ( ? with_watch = true ) t creator perm path = |
let setperms t perm path perms = |
let rm t perm path = |
let list t perm path = r |
let read t perm path = r |
let getperms t perm path = r |
let commit ~ con t = true false ) in ) ; true in false else in has_commited |
module Hash = struct type t = Ledger_hash . t let merge = Ledger_hash . merge let hash_account = Fn . compose Ledger_hash . of_digest Account . digest let empty_account = Ledger_hash . of_digest Account . empty_digest end ( module struct let precomputed_values = Lazy . force Precomputed_values . compile... |
module T = struct include Blake2 . Make ( ) end |
module Base58_check = Codable . Make_base58_check ( struct type t = Stable . Latest . t [ @@ deriving bin_io_unversioned , compare ] compare let version_byte = Base58_check . Version_bytes . transaction_hash let description = " Transaction Hash " end ) end [ %% define_locally |
let to_yojson t = ` String ( to_base58_check t ) t |
let of_yojson = function | ` String str -> Result . map_error ( of_base58_check str ) str ~ f ( : fun _ -> " Transaction_hash . of_yojson : Error decoding string from base58_check \ format " ) | _ -> Error " Transaction_hash . of_yojson : Expected a string " |
let hash_signed_command = Fn . compose digest_string Signed_command . to_base58_check |
let hash_command = Fn . compose digest_string User_command . to_base58_check |
let hash_fee_transfer = Fn . compose digest_string Fee_transfer . Single . to_base58_check |
let hash_coinbase = Fn . compose digest_string Coinbase . to_base58_check |
module User_command_with_valid_signature = struct type hash = T . t [ @@ deriving sexp , compare , hash ] hash let hash_to_yojson = to_yojson let hash_of_yojson = of_yojson [ %% versioned module Stable = struct module V2 = struct type t = ( ( User_command . Valid . Stable . V2 . t [ t ... |
module User_command = struct type hash = T . t [ @@ deriving sexp , compare , hash ] hash let hash_to_yojson = to_yojson let hash_of_yojson = of_yojson [ %% versioned module Stable = struct module V2 = struct type t = ( ( User_command . Stable . V2 . t [ t @ hash . ignore ] ignore )... |
module State = struct [ %% versioned module Stable = struct module V1 = struct type t = Pending | Included | Unknown [ @@ deriving equal , sexp , compare ] compare let to_latest = Fn . id end end ] end let to_string = function | Pending -> " PENDING " | Included -> " INCLUDED " | Unk... |
let get_status ~ frontier_broadcast_pipe ~ transaction_pool cmd = let open Or_error . Let_syntax in let % map check_cmd = Result . of_option ( User_command . check cmd ) cmd ~ error ( : Error . of_string " Invalid signature ) " |> Result . map ~ f ( : fun x -> Transaction_hash . User_com... |
module type Transition_frontier_intf = sig type t type staged_ledger module Breadcrumb : sig type t val staged_ledger : t -> staged_ledger end type best_tip_diff = { new_commands : User_command . Valid . t With_status . t list ; removed_commands : User_command . Valid . t With_status . t list ; reorg_b... |
module Diff_versioned = struct [ %% versioned module Stable = struct [ @@@ no_toplevel_latest_type ] no_toplevel_latest_type module V2 = struct type t = User_command . Stable . V2 . t list [ @@ deriving sexp , yojson , hash ] hash let to_latest = Fn . id end end ] end type t = User_command . ... |
type Structured_log_events . t += | Rejecting_command_for_reason of { command : User_command . t ; reason : Diff_versioned . Diff_error . t ; error_extra : ( string * Yojson . Safe . t ) t list } [ @@ deriving register_event { msg = " Rejecting command because : $ reason " } ] |
module type S = sig open Intf type transition_frontier module Resource_pool : sig include Transaction_resource_pool_intf with type transition_frontier := transition_frontier module Diff : Transaction_pool_diff_intf with type resource_pool := t and type Diff_error . t = Diff_versioned . Diff_error . t and type R... |
module Make0 ( Base_ledger : Intf . Base_ledger_intf ) Base_ledger_intf ( Staged_ledger : sig type t val ledger : t -> Base_ledger . t end ) end ( Transition_frontier : Transition_frontier_intf with type staged_ledger := Staged_ledger . t ) t = struct type verification_failure = | Command_fail... |
module Make ( Staged_ledger : sig type t val ledger : t -> Mina_ledger . Ledger . t end ) end with type staged_ledger := Staged_ledger . t ) t : S with type transition_frontier := Transition_frontier . t = Make0 ( Mina_ledger . Ledger ) Ledger ( Staged_ledger ) Staged_ledger ( Transition_fr... |
let top_hash_logging_enabled = ref false |
let to_preunion ( t : Transaction . t ) t = match t with | Command ( Signed_command x ) x -> ` Transaction ( Transaction . Command x ) x | Fee_transfer x -> ` Transaction ( Fee_transfer x ) x | Coinbase x -> ` Transaction ( Coinbase x ) x | Command ( Parties x ) x -> ` Part... |
let with_top_hash_logging f = let old = ! top_hash_logging_enabled in top_hash_logging_enabled := true ; try let ret = f ( ) in top_hash_logging_enabled := old ; ret with err -> top_hash_logging_enabled := old ; raise err |
module Proof_type = struct [ %% versioned module Stable = struct module V1 = struct type t = [ ` Base | ` Merge ] [ @@ deriving compare , equal , hash , sexp , yojson ] yojson let to_latest = Fn . id end end ] end end |
module Pending_coinbase_stack_state = struct module Init_stack = struct [ %% versioned module Stable = struct module V1 = struct type t = Base of Pending_coinbase . Stack_versioned . Stable . V1 . t | Merge [ @@ deriving sexp , hash , compare , equal , yojson ] yojson let to_latest = Fn . id en... |
module Statement = struct module Poly = struct [ %% versioned module Stable = struct module V2 = struct type ( ' ledger_hash , ' amount , ' pending_coinbase , ' fee_excess , ' sok_digest , ' local_state ) t = { source : ( ' ledger_hash , ' pending_coinbase , ' local_state ) Reg... |
module Proof = struct [ %% versioned module Stable = struct module V2 = struct type t = Pickles . Proof . Proofs_verified_2 . Stable . V2 . t [ @@ deriving version { asserted } , yojson , bin_io , compare , equal , sexp , hash ] hash let to_latest = Fn . id end end ] end end [ %% ver... |
module Stable = struct module V2 = struct type t = { statement : Statement . With_sok . Stable . V2 . t ; proof : Proof . Stable . V2 . t } [ @@ deriving compare , equal , fields , sexp , version , yojson , hash ] hash let to_latest = Fn . id end end ] end |
let proof t = t . proof |
let statement t = { t . statement with sok_digest = ( ) } |
let sok_digest t = t . statement . sok_digest |
let create ~ statement ~ proof = { statement ; proof } |
let chain if_ b ~ then_ ~ else_ = let % bind then_ = then_ and else_ = else_ in if_ b ~ then_ ~ else_ |
module Parties_segment = struct module Spec = struct type single = { auth_type : Control . Tag . t ; is_start : [ ` Yes | ` No | ` Compute_in_circuit ] } type t = single list end module Basic = struct module N = Side_loaded_verification_key . Max_branches [ %% versioned module Stable = s... |
let dummy_constraints ( ) = make_checked Impl ( . fun ( ) -> let x = exists Field . typ ~ compute ( : fun ( ) -> Field . Constant . of_int 3 ) 3 in let g = exists Inner_curve . typ ~ compute ( : fun _ -> Inner_curve . one ) one in ignore ( Pickles . Scalar_challenge . to_fiel... |
module Base = struct module User_command_failure = struct type ' bool t = { predicate_failed : ' bool ; source_not_present : ' bool ; receiver_not_present : ' bool ; amount_insufficient_to_create : ' bool ; token_cannot_create : ' bool ; source_insufficient_balance : ' bool ; source_minimu... |
module Transition_data = struct type t = { proof : Proof_type . t ; supply_increase : Amount . t ; fee_excess : Fee_excess . t ; sok_digest : Sok_message . Digest . t ; pending_coinbase_stack_state : Pending_coinbase_stack_state . t } [ @@ deriving fields ] fields end |
module Merge = struct open Tick let % snarkydef main ( [ s1 ; s2 ] : ( Statement . With_sok . var * ( Statement . With_sok . var * _ ) _ ) _ Pickles_types . Hlist . HlistId . t ) ( s : Statement . With_sok . Checked . t ) t = let % bind fee_excess = Fee_excess . combine_... |
type tag = ( Statement . With_sok . Checked . t , Statement . With_sok . t , Nat . N2 . n , Nat . N5 . n ) Pickles . Tag . t |
let time lab f = let start = Time . now ( ) in let x = f ( ) in let stop = Time . now ( ) in printf " % s : % s \ n " %! lab ( Time . Span . to_string_hum ( Time . diff stop start ) start ) start ; x |
let system ~ proof_level ~ constraint_constants = time " Transaction_snark . system " ( fun ( ) -> Pickles . compile ~ cache : Cache_dir . cache ( module Statement . With_sok . Checked ) Checked ( module Statement . With_sok ) With_sok ~ typ : Statement . With_sok . typ ~ branc... |
module Verification = struct module type S = sig val tag : tag val verify : ( t * Sok_message . t ) t list -> bool Async . Deferred . t val id : Pickles . Verification_key . Id . t Lazy . t val verification_key : Pickles . Verification_key . t Lazy . t val verify_against_digest : t -> bool Async . ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.