Skip to content
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

Allow re-signing of IS locks when performing retroactive signing #3219

Merged
merged 10 commits into from Dec 6, 2019

Conversation

codablock
Copy link

This PR implements re-signing of IS locks, which however is only performed when a non-locked TX appears in a new block. This is required to make retroactive signing work in cases where parts of the network has already seen the TX via mempool and other parts only see it first via a block.

In such cases, the first part of the network (via mempool) might have run into a timeout for the signing sessions, which causes the session to never be completed even if the other part of the network does the signing when it finally receives the TX via a block.

With this PR, the first part of the network will re-sign the TX when necessary at the time it receives the block. This ensures that all necessary signature shares can be collected and the IS lock be formed.

This PR also implements a set of tests for retroactive signing. The tests performed in test_single_node_session_timeout are the ones that test the new behavior. All other tests are testing already existing behavior.

@codablock codablock added this to the 15 milestone Dec 3, 2019
src/rpc/net.cpp Outdated Show resolved Hide resolved
test/functional/llmq-is-retroactive.py Show resolved Hide resolved
@UdjinM6
Copy link

UdjinM6 commented Dec 5, 2019

It looks like a similar patch with an early reconnection would have to be added to other places after #3221 but that would be incompatible with the logic in these tests I think. So I have a new idea now :) pls see #3222 + 253ba29 + e514ad1 (it still builds on top of #3221)

@codablock
Copy link
Author

I pushed a fix for the failures on Gitlab. I have a loop of this test running since an hour and it didn't fail so far. @UdjinM6 You came to late with your changes :P But I'm looking into it now, looks like you found a better way to simulate mempool inconsistencies

@codablock
Copy link
Author

@UdjinM6 fyi, your fix is running on my machine since about 45 minutes without failure. I tend to throw away my fix and use yours instead

@codablock
Copy link
Author

Rebased on develop after merging in the other small fixes

@codablock
Copy link
Author

I cleaned up and squashed the PR so that it doesn't contain all the "fix" commits

@UdjinM6 UdjinM6 added the RPC Some notable changes to RPC params/behaviour/descriptions label Dec 5, 2019
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

LGTM :)

utACK

@UdjinM6 UdjinM6 merged commit 4c00d98 into dashpay:develop Dec 6, 2019
@codablock codablock deleted the pr_islock_resign branch December 6, 2019 09:07
codablock added a commit to codablock/dash that referenced this pull request Dec 6, 2019
…hpay#3219)

* Implement re-signing of InstantSend inputs when TXs come in via blocks

* Use GetAdjustedTime instead of GetTimeMillis in CSigSharesManager

This allows use of mocktime in tests.

* Expose verifiedProRegTxHash in getpeerinfo and implement wait_for_mnauth

* Allow to wait for IS and CL to NOT happen

* Bump timeout for wait_for_instantlock

* Implement tests for retroactive signing of IS and CLs

* Add wait_for_tx function to DashTestFramework

* Add -whitelist=127.0.0.1 to node0

* Use node3 for isolated block generation

* Don't test for non-receival of TXs on node4/node5
codablock added a commit to codablock/dash that referenced this pull request Dec 6, 2019
…hpay#3219)

* Implement re-signing of InstantSend inputs when TXs come in via blocks

* Use GetAdjustedTime instead of GetTimeMillis in CSigSharesManager

This allows use of mocktime in tests.

* Expose verifiedProRegTxHash in getpeerinfo and implement wait_for_mnauth

* Allow to wait for IS and CL to NOT happen

* Bump timeout for wait_for_instantlock

* Implement tests for retroactive signing of IS and CLs

* Add wait_for_tx function to DashTestFramework

* Add -whitelist=127.0.0.1 to node0

* Use node3 for isolated block generation

* Don't test for non-receival of TXs on node4/node5
MIPPL pushed a commit to biblepay/biblepay that referenced this pull request Jan 1, 2020
…ttack vector)

* commit '2ae1ce4800a22c717b67aea97680bbe1eeffa07b':
  [v0.14.0.x] Update release notes with notable changes and changelog (dashpay#3229)
  [v0.14.0.x] Make sure mempool txes are properly processed by CChainLocksHandler despite node restarts (dashpay#3230)
  [v0.14.0.x] Bump version and prepare release notes (dashpay#3228)
  More fixes in llmq-is-retroactive tests
  Make llmq-is-retroactive test compatible with 0.14.0.x
  Make wait_for_xxx methods compatible with 0.14.0.x
  Allow re-signing of IS locks when performing retroactive signing (dashpay#3219)
  Add wait_for_xxx methods as found in develop
  More/better logging for InstantSend
  Tests: Fix the way nodes are connected to each other in setup_network/start_masternodes (dashpay#3221)
  More fixes related to extra_args
  Tests: Allow specifying different cmd-line params for each masternode (dashpay#3222)
  Don't join thread in CQuorum::~CQuorum when called from within the thread (dashpay#3223)
  Merge bitcoin#12392: Fix ignoring tx data requests when fPauseSend is set on a peer (dashpay#3225)

# Conflicts:
#	configure.ac
#	doc/man/biblepay-cli.1
#	doc/man/biblepay-qt.1
#	doc/man/biblepay-tx.1
#	doc/man/biblepayd.1
#	doc/release-notes.md
#	qa/pull-tester/rpc-tests.py
#	qa/rpc-tests/test_framework/test_framework.py
#	src/clientversion.h
barrystyle pushed a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
…hpay#3219)

* Implement re-signing of InstantSend inputs when TXs come in via blocks

* Use GetAdjustedTime instead of GetTimeMillis in CSigSharesManager

This allows use of mocktime in tests.

* Expose verifiedProRegTxHash in getpeerinfo and implement wait_for_mnauth

* Allow to wait for IS and CL to NOT happen

* Bump timeout for wait_for_instantlock

* Implement tests for retroactive signing of IS and CLs

* Add wait_for_tx function to DashTestFramework

* Add -whitelist=127.0.0.1 to node0

* Use node3 for isolated block generation

* Don't test for non-receival of TXs on node4/node5
FornaxA pushed a commit to ioncoincore/ion that referenced this pull request Jul 6, 2020
…hpay#3219)

* Implement re-signing of InstantSend inputs when TXs come in via blocks

* Use GetAdjustedTime instead of GetTimeMillis in CSigSharesManager

This allows use of mocktime in tests.

* Expose verifiedProRegTxHash in getpeerinfo and implement wait_for_mnauth

* Allow to wait for IS and CL to NOT happen

* Bump timeout for wait_for_instantlock

* Implement tests for retroactive signing of IS and CLs

* Add wait_for_tx function to IonTestFramework

* Add -whitelist=127.0.0.1 to node0

* Use node3 for isolated block generation

* Don't test for non-receival of TXs on node4/node5

Signed-off-by: cevap <dev@i2pmail.org>
cryptolinux pushed a commit to cryptolinux/ion that referenced this pull request Feb 6, 2021
…hpay#3219)

* Implement re-signing of InstantSend inputs when TXs come in via blocks

* Use GetAdjustedTime instead of GetTimeMillis in CSigSharesManager

This allows use of mocktime in tests.

* Expose verifiedProRegTxHash in getpeerinfo and implement wait_for_mnauth

* Allow to wait for IS and CL to NOT happen

* Bump timeout for wait_for_instantlock

* Implement tests for retroactive signing of IS and CLs

* Add wait_for_tx function to IonTestFramework

* Add -whitelist=127.0.0.1 to node0

* Use node3 for isolated block generation

* Don't test for non-receival of TXs on node4/node5

Signed-off-by: cevap <dev@i2pmail.org>
ckti pushed a commit to ckti-gitian-ion/ion that referenced this pull request Mar 29, 2021
…hpay#3219)

* Implement re-signing of InstantSend inputs when TXs come in via blocks

* Use GetAdjustedTime instead of GetTimeMillis in CSigSharesManager

This allows use of mocktime in tests.

* Expose verifiedProRegTxHash in getpeerinfo and implement wait_for_mnauth

* Allow to wait for IS and CL to NOT happen

* Bump timeout for wait_for_instantlock

* Implement tests for retroactive signing of IS and CLs

* Add wait_for_tx function to IonTestFramework

* Add -whitelist=127.0.0.1 to node0

* Use node3 for isolated block generation

* Don't test for non-receival of TXs on node4/node5

Signed-off-by: cevap <dev@i2pmail.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants