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

Fetch block from a peer if we don't have it #7240

Merged

Commits on Apr 19, 2024

  1. bcli: allow non 0 exit status for getblock call

    This allows us to intercept getblock on a non 0 exit when the block was
    not found. We fill this with something meaningull in future commits.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    b9f28aa View commit details
    Browse the repository at this point in the history
  2. bcli: move getblock call to a separate function

    We move the `geblock` call into a separate function. This allows us to
    call if from various places in the future.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    c5cbcc2 View commit details
    Browse the repository at this point in the history
  3. bcli: add peers array to the stash

    We introduce the peers array that contains the known set of connected
    peers for future reference in case that we couldn't find the block we
    are looking for.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    d3785c9 View commit details
    Browse the repository at this point in the history
  4. bcli: try to fetch block from peer if unknown

    In the case that we have peers left in the peers array and that we could
    not find the block yet, we ask the next peer for the desired block.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    744fbf0 View commit details
    Browse the repository at this point in the history
  5. bcli: add version check

    `getblockfrompeer` was introduced in v23.0.0, we want to skip this path
    if the version of bitcoind used is below that.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    17a8be5 View commit details
    Browse the repository at this point in the history
  6. tests: add tests for getblockfrompeer

    Changelog-Changed: Plugins: bcli: Add a path that tries to fetch blocks
    from a peer if we can not find them locally.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    64c3b1b View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. ci: Update elementsd version used for tests

    Using `getblockfrompeer` requires a version equal or above 23.0.0
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    5ab1ff5 View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2024

  1. bcli: change iteration order on peerlist

    It is simpler to just iterate through the peerlist backwards.
    
    Signed-off-by: Peter Neuroth <[email protected]>
    nepet committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    6d60c86 View commit details
    Browse the repository at this point in the history