Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ability to Run as Full Simulator #165

Merged
merged 7 commits into from
Mar 13, 2024

Commits on Mar 8, 2024

  1. Configuration menu
    Copy the full SHA
    2447510 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. sim-node: add channel state tracking for channels

    This commit adds a ChannelState struct which is used to track the
    policy and state of a channel in the *outgoing* direction. This will
    be used to check forwards against the node's advertised policy and
    track the movement of outgoing HTLCs through the channel.
    
    Note that we choose to implement this state *unidirectionally*, so a
    single channel will be represented by two ChannelState structs (one in
    each direction).
    carlaKC committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    0028e30 View commit details
    Browse the repository at this point in the history
  2. sim-lib: add simulated channel representation

    Add a single representation of a simulated lightning channel which
    uses our state representation to add and remove htlcs. For simplicity,
    each side of the channel is represented as a separate state, with the
    only interaction between the two through the changes to local balance
    that happen when we settle htlcs.
    carlaKC committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    0e4ccd2 View commit details
    Browse the repository at this point in the history
  3. sim-lib: add SimNode implementation of LightningNode

    Add an implementation of the LightningNode trait that represents
    the underlying lightning node. This implementation is intentionally
    kept simple, depending on some SimNetwork trait to handle the mechanics
    of actually simulating the flow of payments through a simulated graph.
    carlaKC committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    c420b7e View commit details
    Browse the repository at this point in the history
  4. sim_node: add display and is_critical for forwarding error

    We want to be able to distinguish between expected and critical payment
    errors in our simulated payments. An expected error occurs due to a
    lightning-related failure (such as running out of liquidity), and a
    critical one happens because something has gone wrong with our
    simulator (for example, an assertion failure about balances).
    
    This commit adds an some utilities to ForwardingError to make this
    distinction and display errors properly.
    carlaKC committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    b4c906a View commit details
    Browse the repository at this point in the history
  5. sim-lib: add graph implementation of SimNetwork trait

    Add an implementation of our SimNetwork trait that will do the heavy
    lifting of propagating htlcs through a simulated network.
    carlaKC committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    6ea47bb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f155904 View commit details
    Browse the repository at this point in the history