package octez-internal-libs

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

Module Node.PortableSource

Portable form of a node implementation that can be constructed from a concrete representation and used in computing hashes. Conceptually, a Node.Portable.t is a Node.t in which all internal keys have been replaced with the hashes of the values they point to.

Computations over Portable.t values must commute with those over ts, as in the following diagram:

   ┌────────┐       ┌─────────┐  of_node   ┌────────────────┐
   │  Key   │       │  Node   │ ─────────> │ Node.Portable  │
   └────────┘       └─────────┘            └────────────────┘
     │    │  add/remove  │                         │
  to_hash └───────────> (+)     add/remove         │
     │    ┌──────────────┼──────────────────────> (+)
     v    │              v                         v
   ┌────────┐       ┌─────────┐            ┌────────────────┐
   │  Hash  │       │  Node'  │ ─────────> │ Node.Portable' │
   └────────┘       └─────────┘  of_node   └────────────────┘
Sourcemodule Of_node (S : S) : sig ... end

A node implementation with hashes for keys is trivially portable:

Sourcemodule type S = sig ... end
OCaml

Innovation. Community. Security.