-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
llmq|rpc|test|version: Implement P2P messages QGETDATA <-> QDATA #3953
llmq|rpc|test|version: Implement P2P messages QGETDATA <-> QDATA #3953
Conversation
be47c80
to
a55ac9a
Compare
51c69a3
to
eed0929
Compare
eed0929
to
4411f35
Compare
4411f35
to
1b7519e
Compare
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.
Looks good! Will push them with the rebase after #3969 :) In the meantime, back to draft here one more time 😄 |
PEP8 format, which we mostly follow, wants all lines wrapped at 80 chars. That's not practical in a lot of situations / is annoying to do for EVERY line, but here it is |
test/functional/p2p_quorum_data.py
Outdated
p2p_mn1.test_qgetdata(qgetdata_contributions, 0, 0, self.llmq_size) | ||
wait_for_banscore(mn1.node, id_p2p_mn1, 25) | ||
# Request both | ||
p2p_mn1.test_qgetdata(qgetdata_all, 0, self.llmq_threshold, self.llmq_size) | ||
wait_for_banscore(mn1.node, id_p2p_mn1, 50) |
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.
Why does this bump ban score?
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.
I requests more than once within EXPIRATION_TIMEOUT
window
Line 500 in 0b0a7a0
errorHandler("Request limit exceeded", 25); |
Signed-off-by: pasta <pasta@dashboost.org>
I got the general idea behind its just that the execution of the idea looks arbitrary because you picked just two random lines out the many which are above 80 chars. But okay, picked it..🙈 |
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.
LGTM, utACK
Please see 07a906d I think I'm emotionally done with it for now |
Signed-off-by: pasta <pasta@dashboost.org>
Just takes a lot time and isn't required imo.
This was introduced in 9e224ec
"test_mnauth_restriction", "test_invalid_messages" and "test_invalid_unexpected_qdata" with the resulting name "test_basics" because i don't feel like DKG recovery thing should be part of a test called "test_invalid_messages" and giving it an own test probably wouldn't make a lot sense because it would still depend on "test_invalid_messages". I also think there is no need for a separated "test_invalid_unexpected_qdata".
Thats the default "draw annoying warnings" setting for PyCharm (and IMO a reasonable line length).
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.
I don't think I'm a fan of c1a3387, seems like a regression creating a more complex testing method, instead of having small as reasonable, atomic tests
Pls see UdjinM6@4bcd660 |
@PastaPastaPasta I don't see how this makes anything "too complex".. it just additionally tests a bunch of error codes in one function with mostly the same lines of code.
IMO we should rather see
@UdjinM6 I like that approach in general and i had it like this in the evolution of the test but for some reason it seems to fail to get the correct ID on CI sometimes, see https://gitlab.com/UdjinM6/dash/-/jobs/991707418#L3241 ( |
Okay i just saw this one https://gitlab.com/xdustinface/dash/-/jobs/991429505 where it fails the same for be7c66d so its obviously not related to cc38df2. But i think i at least didn't see this failure before all the recent refactoring. |
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.
utACK
(#3971 should fix random mnauth failures mentioned above)
Nice, so if #3971 fixes it, this means the issue is that mininode didn't send I suspect the actual issue then to be this change where it initially slept 1s which then was maybe just enough to get the |
Not necessarily, could be that mininnode sent it but core was simply too slow at processing the message queue or busy with smth else. But yeah, 2220d61 would do it too I think 👍 |
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.
utACK
…hpay#3953) * version: Bump PROTOCOL_VERSION and MIN_MASTERNODE_PROTO_VERSION * version: Introduce LLMQ_DATA_MESSAGES_VERSION for QGETDATA/QDATA support * test: Bump MY_VERSION to 70219 (LLMQ_DATA_MESSAGES_VERSION) * llmq: Introduce CQuorumDataRequest as wrapper for QGETDATA requests * llmq: Implement CQuorum::{SetVerificationVector, SetSecretKeyShare} * llmq|net|protocol: Implement QGETDATA/QDATA P2P messages * llmq: Restrict processing QGETDATA/QDATA to masternodes only * llmq: Implement request limiting for QGETDATA/QDATA * llmq: Implement CQuorumManger::RequestQuorumData * rpc: Implement "quorum getdata" as wrapper around QGETDATA Allows to trigger sending QGETDATA messages to connected peers by RPC. * test: Handle QGETDATA/QDATA messages in mininode * test: Add data structures to support QGETDATA/QDATA * test: Add some helper in test_framework.py * test: Implement tests for QGETDATA/QDATA in p2p_quorum_data.py * test: Add p2p_quorum_data.py to BASE_SCRIPTS * llmq|test: Add QWATCH support for QGETDATA/QDATA * llmq: Store CQuorumPtr in cache, not CQuorumCPtr * llmq: Fix cache usage after recent changes * Use uacomment to create/find specific p2ps * No need to use network adjusted time here, GetTime should be enough * rpc: check proTxHash * minor tweaks * test: Adjustments after 4e27d65 * llmq: Rename and improve error lambda in CQuorumManager::ProcessMessage * llmq: Process QDATA if -watchquorums is enabled * test: Handle qwatch messages in mininode * test: Add test for -watchquorums support * test: Just some empty lines * test: Properly stop the p2p network thread at the end of the test * rpc: Adjust "quorum getdata" parameter descriptions Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> * rpc: Fix optionality of proTxHash in "quorum getdata" command * test: Test optionality of proTxHash for "quorum getdata" command * test: Be more specific about imports in p2p_quorum_data.py * llmq|rpc: Add some comments about the request.GetDataMask checks * test: Some more empty lines * rpc: One more parameter description Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> * test: Unify assert statements / drop parentheses for all of them * fix typo Signed-off-by: pasta <pasta@dashboost.org> * adjust some line wrapping to 80 chars Signed-off-by: pasta <pasta@dashboost.org> * tests: Seperate out into dif atomic methods, add logging Signed-off-by: pasta <pasta@dashboost.org> * test: Avoid restarting masternodes, just let available requests expire Just takes a lot time and isn't required imo. * test: Drop redundant code/tests after separation This was introduced in 9e224ec * test: Merge three tests "test_mnauth_restriction", "test_invalid_messages" and "test_invalid_unexpected_qdata" with the resulting name "test_basics" because i don't feel like DKG recovery thing should be part of a test called "test_invalid_messages" and giving it an own test probably wouldn't make a lot sense because it would still depend on "test_invalid_messages". I also think there is no need for a separated "test_invalid_unexpected_qdata". * test: Rename test_ratelimiting_banscore -> test_request_limit * test: Apply python style * test: Wrap all at 120 characters Thats the default "draw annoying warnings" setting for PyCharm (and IMO a reasonable line length). * test: Move some variables * test: Optimize for speed * tests: use wait_until in get_mininode_id * test: Don't use `!=` to check for `None` Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com> Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> Co-authored-by: pasta <pasta@dashboost.org>
This PR introduces two new P2P messages and with that it bumps the protocol version to
70219
. They will in a follow up PR be used for DKG data sharing between masternodes. Means this PR only contains the implementation of the messages and their tests.The messages:
QGETDATA
- Ask a masternode for DKG data. Can be both or either of the following:QDATA
- Respond with the requested DKG data.5e858cf, 269ce38 and 38bde3f Contain the most part of the messages implementation
6b55815 Implements tests
285c9bd Introduces a RPC wrapper around
QGETDATA
calledquorum getdata
(I actually only did that to be able to test everything related to the new messages independently in this PR)The other commits are mostly helper around the implementation.
This PR is based on #3929 #3930 #3937 #3943 #3948