package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file sc_rollup_machine_no_proofs.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
(*****************************************************************************)
(*                                                                           *)
(* Open Source License                                                       *)
(* Copyright (c) 2023 Nomadic Labs <contact@nomadic-labs.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.                                                 *)
(*                                                                           *)
(*****************************************************************************)

type void = |

let void =
  Data_encoding.(
    conv_with_guard
      (function (_ : void) -> .)
      (fun _ -> Error "void has no inhabitant")
      unit)

type t = Context_binary.t

type tree = Context_binary.tree

let empty_tree () = Context_binary.(make_empty_context () |> Tree.empty)

module Context_no_proofs = struct
  module Tree = Context_binary.Tree

  type tree = Context_binary.tree

  type proof = void

  let verify_proof = function (_ : proof) -> .

  let produce_proof _context _state _step = assert false

  let proof_before = function (_ : proof) -> .

  let proof_after = function (_ : proof) -> .

  let proof_encoding = void
end

module type S = sig
  val parse_boot_sector : string -> string option

  val pp_boot_sector : Format.formatter -> string -> unit

  include
    Sc_rollup_PVM_sig.S
      with type context = Context_no_proofs.Tree.t
       and type state = Context_no_proofs.tree
       and type proof = void
end

module Arith : S = Sc_rollup_arith.Make (Context_no_proofs)

module Wasm : S =
  Sc_rollup_wasm.V2_0_0.Make (Wasm_2_0_0.Make) (Context_no_proofs)

module Riscv : S = struct
  let parse_boot_sector _ = None

  let pp_boot_sector _fmtr _bs = ()

  type state = tree

  let pp _state = Lwt.return (fun _ _ -> ())

  type context = t

  type hash = Smart_rollup.State_hash.t

  type proof = void

  let proof_encoding = void

  let elim_void = function (_ : void) -> .

  let proof_start_state = elim_void

  let proof_stop_state = elim_void

  let state_hash _state =
    Sc_rollup_riscv.(Protocol_implementation.state_hash (make_empty_state ()))

  let initial_state ~empty = Lwt.return empty

  let install_boot_sector state _bs = Lwt.return state

  let is_input_state ~is_reveal_enabled:_ _state =
    failwith "is_input_state: unimplemented"

  let set_input _input _state = failwith "set_input: unimplemented"

  let eval _state = failwith "eval: unimplemented"

  let verify_proof ~is_reveal_enabled:_ _input_opt = elim_void

  let produce_proof _ctxt ~is_reveal_enabled:_ _input_opt _state =
    failwith "produce_proof: unimplemented"

  type output_proof = void

  let output_proof_encoding = void

  let output_of_output_proof = elim_void

  let state_of_output_proof = elim_void

  let verify_output_proof = elim_void

  let produce_output_proof _ctxt _state _out =
    failwith "produce_output_proof: unimplemented"

  let check_dissection ~default_number_of_sections:_ ~start_chunk:_
      ~stop_chunk:_ _chunks =
    failwith "check_dissection: unimplemented"

  let get_current_level _state = failwith "get_current_level: unimplemented"

  module Internal_for_tests = struct
    let insert_failure _state = failwith "insert_failure: unimplemented"
  end
end
OCaml

Innovation. Community. Security.