package octez-protocol-018-Proxford-libs
Octez protocol 018-Proxford libraries
Install
Dune Dependency
Authors
Maintainers
Sources
octez-19.1.tar.gz
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
doc/src/octez-protocol-018-Proxford-libs.baking/baking_configuration.ml.html
Source file baking_configuration.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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
(*****************************************************************************) (* *) (* Open Source License *) (* Copyright (c) 2021 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. *) (* *) (*****************************************************************************) module Operations_source = struct type t = | Local of {filename : string} | Remote of {uri : Uri.t; http_headers : (string * string) list option} let pp ppf = function | Local {filename} -> Format.pp_print_string ppf filename | Remote {uri; _} -> Format.fprintf ppf "%a" Uri.pp uri let encoding = let open Data_encoding in union ~tag_size:`Uint8 [ case (Tag 1) ~title:"Local" (obj2 (req "filename" string) (req "kind" (constant "Local"))) (function Local {filename} -> Some (filename, ()) | _ -> None) (fun (filename, ()) -> Local {filename}); case (Tag 2) ~title:"Remote" (obj3 (req "uri" string) (opt "http_headers" (list (tup2 string string))) (req "kind" (constant "Remote"))) (function | Remote {uri; http_headers} -> Some (Uri.to_string uri, http_headers, ()) | _ -> None) (fun (uri_str, http_headers, ()) -> Remote {uri = Uri.of_string uri_str; http_headers}); ] end open Protocol.Alpha_context type fees_config = { minimal_fees : Tez.t; minimal_nanotez_per_gas_unit : Q.t; minimal_nanotez_per_byte : Q.t; } type validation_config = | Local of {context_path : string} | Node | ContextIndex of Abstract_context_index.t type nonce_config = Deterministic | Random type state_recorder_config = Filesystem | Memory type per_block_votes_config = { vote_file : string option; liquidity_baking_vote : Protocol.Alpha_context.Per_block_votes.per_block_vote; adaptive_issuance_vote : Protocol.Alpha_context.Per_block_votes.per_block_vote; } type t = { fees : fees_config; nonce : nonce_config; validation : validation_config; retries_on_failure : int; user_activated_upgrades : (int32 * Protocol_hash.t) list; per_block_votes : per_block_votes_config; force_apply : bool; force : bool; state_recorder : state_recorder_config; extra_operations : Operations_source.t option; dal_node_endpoint : Uri.t option; } let default_fees_config = { minimal_fees = (match Tez.of_mutez 100L with None -> assert false | Some t -> t); minimal_nanotez_per_gas_unit = Q.of_int 100; minimal_nanotez_per_byte = Q.of_int 1000; } let default_validation_config = Node (* Unclear if determinist nonces, and more importantly, if [supports_deterministic_nonces] is supported. *) let default_nonce_config = Random let default_retries_on_failure_config = 5 let default_user_activated_upgrades = [] let default_votes_config = { vote_file = None; liquidity_baking_vote = Protocol.Alpha_context.Per_block_votes.Per_block_vote_pass; adaptive_issuance_vote = Protocol.Alpha_context.Per_block_votes.Per_block_vote_pass; } let default_force = false let default_force_apply = false let default_state_recorder_config = Memory let default_extra_operations = None let default_config = { fees = default_fees_config; nonce = default_nonce_config; validation = default_validation_config; retries_on_failure = default_retries_on_failure_config; user_activated_upgrades = default_user_activated_upgrades; per_block_votes = default_votes_config; force_apply = default_force_apply; force = default_force; state_recorder = default_state_recorder_config; extra_operations = default_extra_operations; dal_node_endpoint = None; } let make ?(minimal_fees = default_fees_config.minimal_fees) ?(minimal_nanotez_per_gas_unit = default_fees_config.minimal_nanotez_per_gas_unit) ?(minimal_nanotez_per_byte = default_fees_config.minimal_nanotez_per_byte) ?(nonce = default_nonce_config) ?context_path ?(retries_on_failure = default_retries_on_failure_config) ?(user_activated_upgrades = default_user_activated_upgrades) ?(votes = default_votes_config) ?(force_apply = default_force_apply) ?(force = default_force) ?(state_recorder = default_state_recorder_config) ?extra_operations ?dal_node_endpoint () = let fees = {minimal_fees; minimal_nanotez_per_gas_unit; minimal_nanotez_per_byte} in let validation = match context_path with | None -> Node | Some context_path -> Local {context_path} in { fees; validation; nonce; retries_on_failure; user_activated_upgrades; per_block_votes = votes; force_apply; force; state_recorder; extra_operations; dal_node_endpoint; } let fees_config_encoding : fees_config Data_encoding.t = let open Data_encoding in let q_encoding = conv (fun q -> Q.to_string q) (fun s -> Q.of_string s) string in conv (fun {minimal_fees; minimal_nanotez_per_gas_unit; minimal_nanotez_per_byte} -> (minimal_fees, minimal_nanotez_per_gas_unit, minimal_nanotez_per_byte)) (fun (minimal_fees, minimal_nanotez_per_gas_unit, minimal_nanotez_per_byte) -> {minimal_fees; minimal_nanotez_per_gas_unit; minimal_nanotez_per_byte}) (obj3 (req "minimal_fees" Tez.encoding) (req "minimal_nanotez_per_gas_unit" q_encoding) (req "minimal_nanotez_per_byte" q_encoding)) let validation_config_encoding = let open Data_encoding in union ~tag_size:`Uint8 [ case ~title:"Local" (Tag 0) (obj1 (req "local" string)) (function Local {context_path} -> Some context_path | _ -> None) (fun context_path -> Local {context_path}); case ~title:"Node" (Tag 1) (constant "node") (function Node -> Some () | _ -> None) (fun () -> Node); ] let nonce_config_encoding = let open Data_encoding in union ~tag_size:`Uint8 [ case ~title:"Deterministic" (Tag 0) (constant "deterministic") (function Deterministic -> Some () | _ -> None) (fun () -> Deterministic); case ~title:"Random" (Tag 1) (constant "Random") (function Random -> Some () | _ -> None) (fun () -> Random); ] let retries_on_failure_config_encoding = Data_encoding.int31 let user_activate_upgrades_config_encoding = let open Data_encoding in list (tup2 int32 Protocol_hash.encoding) let liquidity_baking_toggle_vote_config_encoding = Protocol.Alpha_context.Per_block_votes.liquidity_baking_vote_encoding let adaptive_issuance_vote_config_encoding = Protocol.Alpha_context.Per_block_votes.adaptive_issuance_vote_encoding let per_block_votes_config_encoding = let open Data_encoding in def (String.concat "." [Protocol.name; "per_block_votes_config"]) @@ conv (fun {vote_file; liquidity_baking_vote; adaptive_issuance_vote} -> (vote_file, liquidity_baking_vote, adaptive_issuance_vote)) (fun (vote_file, liquidity_baking_vote, adaptive_issuance_vote) -> {vote_file; liquidity_baking_vote; adaptive_issuance_vote}) (obj3 (opt "per_block_vote_file" string) (req "liquidity_baking_vote" liquidity_baking_toggle_vote_config_encoding) (req "adaptive_issuance_vote" adaptive_issuance_vote_config_encoding)) let force_config_encoding = Data_encoding.bool let force_apply_config_encoding = Data_encoding.bool let state_recorder_config_encoding = let open Data_encoding in union ~tag_size:`Uint8 [ case ~title:"Filesystem" (Tag 0) (constant "filesystem") (function Filesystem -> Some () | _ -> None) (fun () -> Filesystem); case ~title:"Memory" (Tag 1) (constant "memory") (function Memory -> Some () | _ -> None) (fun () -> Memory); ] let encoding : t Data_encoding.t = let open Data_encoding in def (String.concat "." [Protocol.name; "baking_configuration"]) ~title:"Baking configuration" ~description:"Baking configuration" @@ conv (fun { fees; validation; nonce; retries_on_failure; user_activated_upgrades; per_block_votes; force_apply; force; state_recorder; extra_operations; dal_node_endpoint; } -> ( ( fees, validation, nonce, retries_on_failure, user_activated_upgrades, per_block_votes, force_apply, force, state_recorder ), (extra_operations, dal_node_endpoint) )) (fun ( ( fees, validation, nonce, retries_on_failure, user_activated_upgrades, per_block_votes, force_apply, force, state_recorder ), (extra_operations, dal_node_endpoint) ) -> { fees; validation; nonce; retries_on_failure; user_activated_upgrades; per_block_votes; force_apply; force; state_recorder; extra_operations; dal_node_endpoint; }) (merge_objs (obj9 (req "fees" fees_config_encoding) (req "validation" validation_config_encoding) (req "nonce" nonce_config_encoding) (req "retries_on_failure" retries_on_failure_config_encoding) (req "user_activated_upgrades" user_activate_upgrades_config_encoding) (req "votes" per_block_votes_config_encoding) (req "force_apply" force_apply_config_encoding) (req "force" force_config_encoding) (req "state_recorder" state_recorder_config_encoding)) (obj2 (opt "extra_operations" Operations_source.encoding) (opt "dal_node_endpoint" Tezos_rpc.Encoding.uri_encoding))) let pp fmt t = let json = Data_encoding.Json.construct encoding t in Format.fprintf fmt "%a" Data_encoding.Json.pp json
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>