-
Notifications
You must be signed in to change notification settings - Fork 36.6k
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 -blocksonly option #6993
Add -blocksonly option #6993
Conversation
Concept ACK |
Should this force wallet off? But I suppose maybe watch-only wallets don't need to submit txns... |
@luke-jr Nah! And, in fact with this set you can still submit txns (though it'll be even more obvious its yours!) Concept Ack. Will test. |
As the code is right now, I don't think you can submit txns... |
@luke-jr Yup see my comment. :) |
@gmaxwell and ruin my record for smallest patch to add a new feature? :) |
Perhaps there is a reason it was record setting? :P |
If, instead of blocking at the mempool it did not getdata, then local transactions would work, and you just need to disable the getdata inhibition for whitebinded peers, and the peer is local-- so you'd keep your same lines of code count. Happy? |
The option should be documented, so yet another line is needed :-) |
What will we do to remote peers relaying transactions to us ignoring we announced that we do not want transactions in |
Concept ACK.
Otherwise there's already |
Concept ACK. |
Use parameter interaction and set |
@MarcoFalke Yes. There was another similar issue raised on IRC: transactions from whitelisted peers. Even though nothing is accepted into the mempool, these are still relayed: https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L4462 |
@@ -4451,7 +4451,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, | |||
assert(recentRejects); | |||
recentRejects->insert(tx.GetHash()); | |||
|
|||
if (pfrom->fWhitelisted) { | |||
if (pfrom->fWhitelisted && GetBoolArg("-whitelistalwaysrelay", true)) { |
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.
Please define a static const bool DEFAULT_WHITELISTALWAYSRELAY = true;
in main.h
and use that
(sorry for making your patch even more hideously huge)
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.
Also, HelpMessage needs update?
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.
@pstratem You can hide them behind showDebug
.
@MarcoFalke I'm not sure we cant to put either of these options in the HelpMessage Unless you know what you're doing these are really not a good idea to change. |
@pstratem: for the sake of a central startup arguments "documentation" I think we need to add a help message for every startup parameter. If it's a debugging/expert only feature, it should be placed behind the |
We really should define something like NODE_BLOCKS and NODE_TXS... Doesn't necessarily need to be in this pull, but worth noting. |
@petertodd agreed |
Needs rebase. And my tested/code ack is held only on the fact that there is a global static setting for the default thats not used everywhere. :( |
There was also talk about sending an empty filterload to peers in this mode, if they support NODE_BLOOM. Edit: utACK |
@laanwj We don't need to send an empty filterload because the relay flag has the same effect! (and doesn't require NODE_BLOOM support) |
bbf49da Fix comment for blocksonly parameter interactions (Patick Strateman) 6a4982f Fix fRelayTxs comment (Patick Strateman) 59441a0 Display DEFAULT_WHITELISTALWAYSRELAY in help text (Patick Strateman) 71a2683 Use DEFAULT_BLOCKSONLY and DEFAULT_WHITELISTALWAYSRELAY constants (Patick Strateman) 762b13b Add help text for blocksonly and whitelistalwaysrelay (Patick Strateman) 3a96497 Add whitelistalwaysrelay option (Patick Strateman) 420fa81 Do not process tx inv's in blocksonly mode (Patick Strateman) 4044f07 Add blocksonly mode (Patick Strateman)
Erk.. This is really ugly... And the pull doesn't even state who needs this functionality or why. |
@rebroad Basically this makes Core a blockchain-only node and disables off-chain transactions. |
@rebroad It's fairly self explanatory. If you want to run a node that only processes blocks (e.g. don't care about unconfirmed transactions); you can set this and save ~80% of your bandwidth, including all redundant transmission of block data; "Blocksonly". This is good for many applications (including my laptop... :) ) |
Ah, I thought I had raised a pull request for my Antisocial fork, but it seems not. I think it would be useful to have an option to do blocksonly during IBD only. Would this be of interest to anyone? |
@rebroad That should already be the case? Most node functionality, such as requesting transactions, is disabled during IBD |
Misc upstream PRs Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6077 - Second commit only (first was already applied to 0.11.X and then reverted) - bitcoin/bitcoin#6284 - bitcoin/bitcoin#6489 - bitcoin/bitcoin#6462 - bitcoin/bitcoin#6647 - bitcoin/bitcoin#6235 - bitcoin/bitcoin#6905 - bitcoin/bitcoin#6780 - Excluding second commit (QT) and third commit (requires bitcoin/bitcoin#6993) - bitcoin/bitcoin#6961 - Excluding QT parts, and a small `src/policy/policy.cpp` change which depends on a bunch of other PRs, which we'll have to remember to come back to. - bitcoin/bitcoin#7044 - bitcoin/bitcoin#8856 - bitcoin/bitcoin#9002 Part of #2074 and #2132.
Misc upstream PRs Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6077 - Second commit only (first was already applied to 0.11.X and then reverted) - bitcoin/bitcoin#6284 - bitcoin/bitcoin#6489 - bitcoin/bitcoin#6235 - bitcoin/bitcoin#6905 - bitcoin/bitcoin#6780 - Excluding second commit (QT) and third commit (requires bitcoin/bitcoin#6993) - bitcoin/bitcoin#6961 - Excluding QT parts, and a small `src/policy/policy.cpp` change which depends on a bunch of other PRs, which we'll have to remember to come back to. - bitcoin/bitcoin#7044 - bitcoin/bitcoin#8856 - bitcoin/bitcoin#9002 Part of #2074 and #2132.
Add -blocksonly option Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6993 - bitcoin/bitcoin#7046 - bitcoin/bitcoin#6780 - The third commit (we backported the rest in #2390). - bitcoin/bitcoin#7126 - bitcoin/bitcoin#7439 - bitcoin/bitcoin#15990 - Only the `-blocksonly` documentation changes. - bitcoin/bitcoin#16555 - bitcoin/bitcoin#18391 - Only the `-blocksonly` documentation changes. Part of #2074.
Set fRelay=false and reject all transactions into the mempool