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
Outbound peers disconnect - implement #2283 #2459
base: 1.15.0-dev
Are you sure you want to change the base?
Outbound peers disconnect - implement #2283 #2459
Conversation
…logically equivalent to the old version but for when called as needed wuth first_invalid.
…ders even if from compact blocks (See BIP 152).
I think that the BIP-152 text referred to is:
Since we do run protocol version 70015 since 1.14.0, and Dogecoin currently has 2.5x higher bandwidth and 10x lower latency requirements than Bitcoin for blocks, this at first glance looks very relevant, because a non-malicious peer will craft and broadcast dogecoin/qa/rpc-tests/p2p-acceptblock.py Lines 337 to 342 in 59da28c
However, this ( dogecoin/src/net_processing.cpp Line 417 in e341979
and that will only be set if the following condition is true: Line 1581 in e341979
and this condition is always false for all 1.14.x clients because of this: Line 110 in e341979
So because the relevance right now is low, I propose to postpone this one until the next minor release, with the note that:
|
@patricklodder I agree. Let's move it to the next minor release. |
As mentioned above, this is blocked by not having |
The base branch was changed.
@patricklodder What is the status of this? |
This is still blocked because we still have no working p2p-compactblocks.py - I'll work on it. |
hey my apologies, i've been oblivious this was blocked on account of the non-functional test. perhaps i was in the know but forgot. :( in any case i had been working on this 12/2021 and gutted most of the segwit code as modeled off an iteration of bitcoin-cash which i unfortunately can't find atm but seeing is how they didn't implement segwit and supported compact blocks i thought it a good reference. omitted the bch ref as it wasn't relevant. the test passes, however i'm not certain it's what we need considering changing the test to make the code pass vs vice versa...anyway if anyone wants to use as a starting point, i've pushed a rebased version here for cherry-picking or whatever if worthy and if not i'll try to find some time to fix it up: |
@@ -247,9 +247,10 @@ bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<cons | |||
* @param[in] block The block headers themselves | |||
* @param[out] state This may be set to an Error state if any error occurred processing them | |||
* @param[in] chainparams The params for the chain we want to connect to | |||
* @param[out] store the invalid block here if there is one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new parameter was added to the end of the method, but this line makes it seem like it is located where the 'ppindex' is. I suggest swapping line 250 with line 251.
#2283 Suggested fix. However, it will disconnect outbound connection even if the invalid header comes from a compact block, which under BIP 152 there are scenarios where that is allowed.
We need a test for this. I would write it, but don't know how to. If someone can take care of that, or teach me how to do it, that would be great.
@rnicoll @patricklodder @michilumin