Repository navigation
Conversation
| return; | ||
| } | ||
|
|
||
| if (CanDisconnectSpamCoinPeer(pfrom, nServices)) { |
There was a problem hiding this comment.
This returns before the stale-outbound handling below, so post-fork DemoteToStaleOutbound and -maxstaleoutbound never run.
There was a problem hiding this comment.
ok but whats the point of -maxstaleoutbound why do we want to connect and keep a stale connection to spam node?
If IBD is done and we are on XBT chain i see 0 reasons to even accept or connect to those nodes...
maybe there is some other reason i dont know about?
There was a problem hiding this comment.
Replay protection is opt-in (SIGHASH_UNIFIED), so legacy wallet tx are still valid for us. Locally measured at tip 130 with the fork at 20, a peer without NODE_BLAKE2B relayed a SIGHASH_ALL tx we accepted and mined. If you disagree, delete -maxstaleoutbound in this PR rather than leave it inert.
There was a problem hiding this comment.
ok makes sense, i think what i'll do is make this more configurable and cooperative for this usecase
but for a normal node that just keep strack of my things not used for mining, i'd completely ban all interaction with spam nodes... for mining node i get it and i'll make it configurable.
| } | ||
|
|
||
| // Peers that connected before shared history was completed are dropped once shared history is synced. | ||
| if (CanDisconnectSpamCoinPeer(*pto, peer->m_their_services)) { |
There was a problem hiding this comment.
For inbound, protecting NODE_BLAKE2B peers in AttemptToEvictConnection gets the same slots without disconnecting anyone.
There was a problem hiding this comment.
i do not get this one, inbound connections are for full nodes, once you're a full blake node, why would you ever allow or want core node to connect?
Why there is any protecting... there should be only blake nodes that can connect and thats donzo.
There was a problem hiding this comment.
Eviction gives BLAKE2b peers the slot when inbound is full and costs nothing while there is room.
There was a problem hiding this comment.
Because it carries valid Bitcoin transactions to us. A legacy node relays whatever passes its own policy, and some of that is data spam we reject at our own door, but the rest is ordinary payments signed SIGHASH_ALL, valid on both chains, that our miners want in their blocks. We are Bitcoin, and Bitcoin processes valid Bitcoin transactions wherever they arrive from. The peer costs us nothing a BLAKE2b peer was using: it cannot serve blocks past the fork, it never holds an outbound slot since it is demoted to a stale outbound, and eviction can prefer BLAKE2b peers inbound when the slots are full. The test in my comment above shows that relay working on 29.4.1 and gone on this branch.
There was a problem hiding this comment.
thanks for clarification, i'll explore more later today
|
Concept NACK. A peer without NODE_BLAKE2B cannot give us blocks past the fork, and 29.4.1 already accounts for that. What it can still give us is transactions, and this PR throws those away. Transaction ids, signatures and wallets are unchanged across the split, and there is no replay protection, so a transaction broadcast to a legacy node is valid here unless it spends an output that only exists on the other chain. Wallets, exchanges and Electrum servers that have not updated still broadcast through legacy nodes. Those are fee-paying transactions our miners want, and they reach us through peers that talk to both networks. Every node that drops legacy peers pushes the two networks toward a partition at the P2P layer, where a transaction has to be broadcast twice on purpose to reach both. That is a cost with nothing on the other side of the ledger. The slot argument is already handled. Outbound dialing prefers NODE_BLAKE2B ( I wrote a functional test for that, Your own Code notes on the current head, in case the approach survives:
To the question of why we would want a node on the other chain connected at all: because it carries transactions for us, and it costs us nothing we were using. |
|
Correction to my comment above: replay protection does exist, as an opt-in. |
|
Concept NACK. We want (some of) the transactions those nodes can give us. And exclusion based on the absence of the BLAKE2B bit will disconnect not only Core nodes but also other peers like NBitcoin, bitcoinj, breadwallet, bitcore (none of which implement Core v30 excess-permissiveness) unnecessarily limiting fee-paying transactions our nodes can benefit from including in blocks. |
I might be wrong but from what i know there are 2 types of node runners, those who use it for mining (in which case what you describe makes sense), and those of us who simply run a node for our own wallets/tools/infra + helping people IBD and relay transactions. I'm the second category (for now), but for mining i'm going to have dedicated separate node+datum.
Personally i like that all my peers are blake2b nodes and that i'm helping them with IBD instead of the spammers. |
This is most definitely not "appropriate" for bitcoin core.
The motivation is simple, i do not want my node to accept/allow or make connections to spam coin nodes (with few exceptions).
The code is mostly self describing and compact (one function 2 call sites).
weArePastSharedHistory && peerLacksBlakeBit && peerIsNotManuallyAdded;There are 2 places where this is being checked/enforced.
During the handshake when we get the version from the peer and inside a polling loop which i believe runs per pear 10 times a second.
Personally i think the handshake check is enough, and second one can be dropped.
Second one is only there because during IBD peers that are from spam chain are helping us sync, their handshake check is passed and they are in. If we want to disconnect them later second check does it. Or we just wait, connection is not going to be there forever i think...
Note : i believe that currently even if you're connected blocks do not sync with spam nodes anyway, but i consider that separate issue that should be fixed separately.