The general idea is to keep track of the user requested blocks so, in
case of a bad behaving peer or a network disconnection, they can be
fetched from another one automatically without any further user interaction.
This was requested by users because the getblockfrompeer RPC command
lacks the functionality to notify them about block request failures or peer
disconnections (which is expected due to the asynchronous nature of the block
requests).
Currently, this new functionality is limited to blocks requested by the
user via the ‘getblockfrompeer’ RPC command.
In the future, this class could expand its scope and be utilized in the
regular chain synchronization process. Or, even could be employed in
special procedures like a prune node rescan that uses BIP158 block filters,
or even into BIP157 itself.
DrahtBot
commented at 7:01 pm on June 7, 2023:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#31583 (rpc: add gettarget , target getmininginfo field and show next block info by Sjors)
#31282 (refactor: Make node_id a const& in RemoveBlockRequest by maflcko)
#28488 (p2p: Evict outbound peers with high minFeeRate by naumenkogs)
#28055 (Bugfix: net_processing: Restore “Already requested” error for FetchBlock by luke-jr)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
DrahtBot added the label
P2P
on Jun 7, 2023
DrahtBot added the label
CI failed
on Jun 7, 2023
maflcko
commented at 7:27 am on June 13, 2023:
member
Maybe mark as draft if CI is red and this is still based on something else?
fanquake marked this as a draft
on Jun 13, 2023
furszy
commented at 9:33 am on June 13, 2023:
member
Oh, didn’t know about the CI failure. Seems to be just an unused variable. But sure, draft until #27836 sounds good.
furszy force-pushed
on Aug 1, 2023
DrahtBot removed the label
CI failed
on Aug 1, 2023
DrahtBot added the label
Needs rebase
on Oct 2, 2023
furszy force-pushed
on Oct 18, 2023
DrahtBot removed the label
Needs rebase
on Oct 18, 2023
DrahtBot added the label
Needs rebase
on Oct 19, 2023
furszy
commented at 11:57 am on January 17, 2024:
member
Focus is on #28170, which is quite close.
Will rebase it as soon as it is merged.
furszy force-pushed
on Mar 11, 2024
furszy marked this as ready for review
on Mar 11, 2024
furszy force-pushed
on Mar 11, 2024
DrahtBot removed the label
Needs rebase
on Mar 11, 2024
DrahtBot added the label
CI failed
on Mar 12, 2024
DrahtBot
commented at 0:18 am on March 12, 2024:
contributor
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
in
test/functional/rpc_getblockfrompeer.py:163
in
ad4fc1bf82outdated
158+ # Test reject fetching old block from a limited peer #
159+ ######################################################
160+
161+ self.log.info("Test reject fetching old block from limited peer")
162+ pruned_node.add_p2p_connection(P2PInterface(), services=NODE_NETWORK_LIMITED | NODE_WITNESS)
163+ limited_peer_id = next(peer for peer in pruned_node.getpeerinfo() if peer["servicesnames"] == ['WITNESS', 'NETWORK_LIMITED'])["id"]
0 test 2024-04-18T12:47:34.188000Z TestFramework (ERROR): Unexpected exception caught during testing
1 Traceback (most recent call last):
2 File "/ci_container_base/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 132, in main
3 self.run_test()
4 File "/ci_container_base/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/rpc_getblockfrompeer.py", line 163, in run_test
5 limited_peer_id = next(peer for peer in pruned_node.getpeerinfo() if peer["servicesnames"] == ['WITNESS', 'NETWORK_LIMITED'])["id"]
6 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 StopIteration
Make sure to run all tests locally, according to the documentation.
The failure may happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
DrahtBot added the label
CI failed
on Aug 29, 2024
maflcko removed the label
Needs CMake port
on Aug 29, 2024
furszy force-pushed
on Aug 29, 2024
DrahtBot added the label
Needs rebase
on Sep 2, 2024
furszy force-pushed
on Oct 1, 2024
DrahtBot removed the label
Needs rebase
on Oct 1, 2024
UdjinM6 referenced this in commit
2c825b4b4a
on Oct 3, 2024
net: FetchBlock, disallow requesting blocks from network limited peersf850847c73
net: FetchBlock, disallow requesting block to the same peer multiple timese64919f78c
net: introduce BlockRequestTracker96e9b44436
rpc: getblockfrompeer, connect block tracking mechanism and add coverage
If the initial block fetching process fails, the p2p layer will be in
charge of fetching the block from 'any' connected peer.
Re-trying to download the block from different peers until it is
received.
afcf77ddb2
RPC: getblockfrompeer, introduce fetch from "any" peer functionality
If no 'peer_id' is provided, 'getblockfrompeer' will just delegate
the peer selection to the internal block downloading logic.
Allowing what we had before, a single block request with no automatic
retry nor tracking mechanism.
b18c72cfcd
furszy force-pushed
on Oct 13, 2024
panleone referenced this in commit
e7c21c7e58
on Nov 11, 2024
DrahtBot
commented at 9:14 pm on January 22, 2025:
contributor
🐙 This pull request conflicts with the target branch and needs rebase.
DrahtBot added the label
Needs rebase
on Jan 22, 2025
DrahtBot
commented at 0:45 am on April 21, 2025:
contributor
⌛ There hasn’t been much activity lately and the patch still needs rebase. What is the status here?
Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
Is it no longer relevant? ➡️ Please close.
Did the author lose interest or time to work on this? ➡️ Please close it and mark it ‘Up for grabs’ with the label, so that it can be picked up in the future.
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-05-08 09:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me