Skip to content

Conversation

@UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Jul 28, 2020

(As discussed in Slack a couple days ago) now that PoSe relies on a protocol version send by other MNs, it makes sense to include it into MNAUTH message to make sure it wasn't forged by a mitm attacker somehow.

Note: bumping MIN_MASTERNODE_PROTO_VERSION will trigger another PoSe-score increase/ban wave for currently deployed testnet nodes running on 70217 once enough nodes are upgraded to this commit which is fine and might even be a desirable thing cause it allows us to test PoSe during protocol bumps once again.

@UdjinM6 UdjinM6 added this to the 16 milestone Jul 28, 2020
// This is ok as we only use MNAUTH as a DoS protection and not for sensitive stuff
signHash = ::SerializeHash(std::make_tuple(*activeMasternodeInfo.blsPubKeyOperator, pnode->receivedMNAuthChallenge, pnode->fInbound));
int nOurNodeVersion{PROTOCOL_VERSION};
if (Params().NetworkIDString() != CBaseChainParams::MAIN && gArgs.IsArgSet("-pushversion")) {
Copy link
Member

Choose a reason for hiding this comment

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

I presume we don't intend to keep this, so maybe add a TODO to remove in either rc4 or final 0.16

Copy link
Author

Choose a reason for hiding this comment

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

Nope, this is needed because we imitate old nodes in feature_llmq_simplepose.py and they should send mnauth in correct format cause otherwise other nodes won't let them connect. Same for ProcessMessage - if we pretend to be an older node we should be expecting other nodes to send us mnauth in old format.

Comment on lines 41 to 43
if (pnode->nVersion < MIN_MASTERNODE_PROTO_VERSION || nOurNodeVersion < MIN_MASTERNODE_PROTO_VERSION) {
signHash = ::SerializeHash(std::make_tuple(*activeMasternodeInfo.blsPubKeyOperator, pnode->receivedMNAuthChallenge, pnode->fInbound));
} else {
Copy link
Member

Choose a reason for hiding this comment

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

I feel like we shouldn't be using MIN_MASTERNODE_PROTO_VERSION here, because assume in v17 we bump min masternode proto, then a v17 node communicating with a v16 node will think that the v16 node doesn't understand version and would exclude it. We should add a new variable representing the protocol that MnAuth was changed, and then this can be removed once min proto version < mnauthaddedprotocol

Copy link
Author

Choose a reason for hiding this comment

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

Good point 👍 fixed

@xdustinface
Copy link

Thats a good one, utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 merged commit a1bcb82 into dashpay:develop Aug 4, 2020
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 23, 2020
* Include protocol version into MNAUTH

* Introduce MNAUTH_NODE_VER_VERSION = 70218
@PastaPastaPasta
Copy link
Member

backported in #3670

@UdjinM6 UdjinM6 deleted the mnauthprotover branch November 26, 2020 13:27
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Mar 11, 2022
* Include protocol version into MNAUTH

* Introduce MNAUTH_NODE_VER_VERSION = 70218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants