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

[2/3]: implement blockbeat #9

Open
wants to merge 10 commits into
base: yy-prepare-blockbeat
Choose a base branch
from

Commits on Oct 15, 2024

  1. chainio: introduce chainio to handle block synchronization

    This commit inits the package `chainio` and defines the interface
    `Blockbeat` and `Consumer`. The `Consumer` must be implemented by other
    subsystems if it requires block epoch subscription.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    b58bfc2 View commit details
    Browse the repository at this point in the history
  2. chainio: implement Blockbeat

    In this commit, a minimal implementation of `Blockbeat` is added to
    synchronize block heights, which will be used in `ChainArb`, `Sweeper`,
    and `TxPublisher` so blocks are processed sequentially among them.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    f59e167 View commit details
    Browse the repository at this point in the history
  3. chainio: add BlockbeatDispatcher to dispatch blockbeats

    This commit adds a blockbeat dispatcher which handles sending new blocks
    to all subscribed consumers.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    84ebdb8 View commit details
    Browse the repository at this point in the history
  4. multi: implement Consumer on subsystems

    This commit implements `Consumer` on `TxPublisher`, `UtxoSweeper`,
    `ChainArbitrator` and `ChannelArbitrator`. In addition, a
    `BlockConsumer` is added to save code duplication.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    d35d009 View commit details
    Browse the repository at this point in the history
  5. sweep: remove block subscription in UtxoSweeper and TxPublisher

    This commit removes the independent block subscriptions in `UtxoSweeper`
    and `TxPublisher`. These subsystems now listen to the `BlockbeatChan`
    for new blocks.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    8629c0c View commit details
    Browse the repository at this point in the history
  6. contractcourt: remove waitForHeight in resolvers

    The sweeper can handle the waiting so there's no need to wait for blocks
    inside the resolvers. By offering the inputs prior to their mature
    heights also guarantees the inputs with the same deadline are
    aggregated.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c1048b8 View commit details
    Browse the repository at this point in the history
  7. contractcourt: remove block subscription in arbitrators

    This commit removes the block subscriptions used in `ChainArbitrator`
    and `ChannelArbitrator`, replaced them with the blockbeat managed by
    `BlockbeatDispatcher`.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    2a5fb03 View commit details
    Browse the repository at this point in the history
  8. contractcourt: remove the immediate param used in Resolve

    This `immediate` flag was added as a hack so during a restart, the
    pending resolvers would offer the inputs to the sweeper and ask it to
    sweep them immediately. This is no longer need due to `blockbeat`, as
    now during restart, a block is always sent to all subsystems via the
    flow `ChainArb` -> `ChannelArb` -> resolvers -> sweeper. Thus, when
    there are pending inputs offered, they will be processed by the sweeper
    immediately.
    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c594915 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    54d8b17 View commit details
    Browse the repository at this point in the history
  10. multi: improve loggings

    yyforyongyu committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    d76a26e View commit details
    Browse the repository at this point in the history