Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented May 9, 2019

This is de-facto no longer hidden

This helps to distinguish it from CNode::fRelayTxes and avoid bugs like
425278d
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fae9f79.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 9, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15984 (net: Remove -whitelistrelay by MarcoFalke)
  • #15759 ([p2p] Add 2 outbound blocks-only connections by sdaftuar)

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.

@gmaxwell
Copy link
Contributor

Great work!

@maflcko maflcko force-pushed the 1905-docTestBlocksOnly branch from fae9f79 to fac2396 Compare May 10, 2019 11:30
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fac2396. Nice tests and docs. TIL blocksonly is no longer hidden.

Before:

$ bitcoind -help-debug | grep -A3 -- -blocksonly
  -blocksonly
       Whether to operate in a blocks only mode (default: 0)

$ bitcoind -help | grep -A3 -- -blocksonly

After:

$ bitcoind -help-debug | grep -A3 -- -blocksonly
  -blocksonly
       Whether to reject transactions from network peers. Transactions from the
       wallet or RPC are not affected. (default: 0)

$ bitcoind -help | grep -A3 -- -blocksonly
  -blocksonly
       Whether to reject transactions from network peers. Transactions from the
       wallet or RPC are not affected. (default: 0)

@maflcko maflcko force-pushed the 1905-docTestBlocksOnly branch from fac2396 to fa9c829 Compare May 13, 2019 13:21
@maflcko
Copy link
Member Author

maflcko commented May 13, 2019

Replied to or addressed @jonatack s nits. Only doc-changes in the last force push

@maflcko
Copy link
Member Author

maflcko commented May 13, 2019

Also addressed @promag s feedback

@jamesob
Copy link
Contributor

jamesob commented May 13, 2019

Concept ACK - will review today.

@@ -35,3 +35,14 @@ blocks and transactions to fewer nodes.
Reducing the maximum connected nodes to a minimum could be desirable if traffic
limits are tiny. Keep in mind that bitcoin's trustless model works best if you are
connected to a handful of nodes.

## 4. Turn off transaction relay (`-blocksonly`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3 great doc.

assert_equal(self.nodes[0].getnetworkinfo()['localrelay'], False)
with self.nodes[0].assert_debug_log(['transaction sent in violation of protocol peer=0']):
self.nodes[0].p2p.send_message(msg_tx(FromHex(CTransaction(), sigtx)))
self.nodes[0].p2p.sync_with_ping()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm just being thick here, but shouldn't we assert that the mininode hasn't received a message containing the new tx from self.nodes[0] after this sync_with_ping()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean spinning up a second mininode to check that that one didn't receive it?

I think adding a getmempoolinfo()['size']==0 should do the same?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the latter sounds good.

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fa9c829. One suggested change to the docs.

@maflcko maflcko force-pushed the 1905-docTestBlocksOnly branch from fa9c829 to 979519e Compare May 13, 2019 14:41
@maflcko maflcko force-pushed the 1905-docTestBlocksOnly branch from 979519e to fa8ced3 Compare May 13, 2019 14:45
@jamesob
Copy link
Contributor

jamesob commented May 13, 2019

utACK fa8ced3

Only changes since 979519e are adding a mempool assertion and a period to the docs. Nice PR!

@laanwj
Copy link
Member

laanwj commented May 16, 2019

utACK fa8ced3, thanks for adding documentation!

@laanwj laanwj merged commit fa8ced3 into bitcoin:master May 16, 2019
laanwj added a commit that referenced this pull request May 16, 2019
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
@maflcko maflcko deleted the 1905-docTestBlocksOnly branch May 16, 2019 17:14
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 16, 2019
This helps to distinguish it from CNode::fRelayTxes and avoid bugs like
425278d

Github-Pull: bitcoin#15990
Rebased-From: fa1dce7
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 16, 2019
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 16, 2019
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 16, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 18, 2019
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK bitcoin@fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
@laanwj laanwj removed this from the 0.18.1 milestone Jul 18, 2019
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Aug 23, 2019
This helps to distinguish it from CNode::fRelayTxes and avoid bugs like
425278d

Github-Pull: bitcoin#15990
Rebased-From: fa1dce7
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Aug 23, 2019
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Aug 23, 2019
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Aug 23, 2019
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
This helps to distinguish it from CNode::fRelayTxes and avoid bugs like
425278d

Github-Pull: bitcoin#15990
Rebased-From: fa1dce7
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 8, 2020
Summary:
 * net: Rename ::fRelayTxes to ::g_relay_txes

This helps to distinguish it from CNode::fRelayTxes and avoid bugs like
425278d

 * test: Format predicate source as multiline on error

 * test: Add test for p2p_blocksonly

 * doc: Mention blocksonly in reduce-traffic.md, unhide option

This is a backport of Core [[bitcoin/bitcoin#15990 | PR15990]]

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D6424
zkbot added a commit to zcash/zcash that referenced this pull request Mar 31, 2021
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.
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 25, 2021
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK bitcoin@fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 20, 2021
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK bitcoin@fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 20, 2021
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK bitcoin@fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 21, 2021
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK bitcoin@fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 9, 2022
fa8ced3 doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK bitcoin@fa8ced3

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants