Page MenuHomePhabricator

[avalanche] set a minimum amount for a proof
ClosedPublic

Authored by PiRK on Mar 23 2021, 17:27.

Details

Reviewers
majcosta
deadalnix
Group Reviewers
Restricted Project
Commits
rABC6bcc0e609cb0: [avalanche] set a minimum amount for a proof
Summary

This bumps the dust threshold per UTXO in a proof to 1 coin and fixes tests accordingly.

PROOF_DUST_THRESOLD is moved from proof.cpp to proof.h so it is available for tests.

Depends on D9441

Test Plan

ninja all check-all

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

mmove constexprs into the avalanche namespace
rename MIN_SCORE_DUST -> SCORE_DUST_THRESHOLD

deadalnix requested changes to this revision.Apr 3 2021, 20:37
deadalnix added inline comments.
src/avalanche/test/peermanager_tests.cpp
165 ↗(On Diff #28064)

A lot of these test are not testing for the dust threshold, right? So SCORE_DUST_THRESHOLD isn't actually what you want? So what is it that you want? Maybe the minimal score that would generate a valid proof?

src/avalanche/test/proof_tests.cpp
29–37 ↗(On Diff #28064)

You could make this way more generic without doing much of anything.

30–37 ↗(On Diff #28064)
443 ↗(On Diff #28064)

Now you are testing the dust threshold, so this is what you want.

This revision now requires changes to proceed.Apr 3 2021, 20:37
src/avalanche/test/peermanager_tests.cpp
165 ↗(On Diff #28064)

Maybe the minimal score that would generate a valid proof?

That's exactly what MIN_SCORE_DUST / SCORE_DUST_THRESHOLD was meant to mean.

refactor conditional check of ProofValidationResult as suggested in the review

I had to BOOST_CHECK(state.GetResult() == expected_state); instead of BOOST_CHECK_EQUAL(state.GetResult(), expected_state);.
The latter causes a very long stack of compilation errors because the "Enable BOOST_CHECK_EQUAL for enum class types" trick in setyp_common.h does not appear to work in this case.

deadalnix requested changes to this revision.Apr 7 2021, 15:40
deadalnix added inline comments.
src/avalanche/test/peermanager_tests.cpp
165 ↗(On Diff #28073)

Does it matter that this is the proof dust threshold?

I don't think it does.

This revision now requires changes to proceed.Apr 7 2021, 15:40

SCORE_DUST_THRESHOLD -> LOWEST_VALID_SCORE

deadalnix requested changes to this revision.Apr 8 2021, 13:18
deadalnix added inline comments.
src/avalanche/test/proof_tests.cpp
30 ↗(On Diff #28083)

What you want here is NOT the lowest valid score.

Please. These two things have the same value, but they are NOT the same thing. The whole reason you give it a name to begin with is to identify what that is.

This revision now requires changes to proceed.Apr 8 2021, 13:18

new attempt at getting this unstuck: restore the proof_random test as close as possible to its initial state, don't test for the ProofValidationResult::DUST_THRESOLD, just make sure the score given to buildRandomProof is always valid.

deadalnix requested changes to this revision.Apr 14 2021, 15:31

On a side, note, if we commit to the proof score being the amount in satoshi, how do we handle overflows?

src/avalanche/test/proof_tests.cpp
25

This is going to skew the distribution quite considerably.

I don't think there a major issue with tripping the dust threshold error path with randomly generated proofs. is there a reason we want to avoid doing that?

343

Is there a reason to make this amount dependent on the dust threshold?

437

Why not 1 * SATOSHI ?

src/avalanche/test/util.h
16
// Minimum score for the proof to be valid

Then shouldn't this be something alike to MIN_VALID_PROOF_SCORE ?

Clearly, you thought the name was confusing because you added a comment. So make the name explicit.

test/functional/abc_rpc_avalancheproof.py
114

likestamp

This revision now requires changes to proceed.Apr 14 2021, 15:31
src/avalanche/test/proof_tests.cpp
25

My idea was not to change the actual meaning of this test. With the previous change, it tested more stuff than previously. Instead of just testing that valid proofs verify successfuly, it tested ProofValidationStates of invalid proofs.

But I see what you mean, now it's not as random anymore.

I'm still not sure what name[[ https://reviews.bitcoinabc.org/D9345?id=28083#inline-46121 | you think would be better for the threshold ]], if we go back to testing dust thresholds.

343

It's a guarantee that it will remain valid in the future if the threshold is changes.

rename LOWEST_VALID_SCORE -> MIN_VALID_PROOF_SCORE

In the proof_random test, don't avoid tripping the dust threshold error path. Add a function to test whether a given proof will trip the path, independently of how the proof is built. This removes the assumption that buildAvalancheProof will always generate single stake proofs with their value only depending on the score.

deadalnix requested changes to this revision.Apr 20 2021, 00:09

This is pretty much good to go. Make sure isProofStateDustThreshold has a descriptive name.

src/avalanche/test/util.h
15 ↗(On Diff #28199)

Try to put the 100 * in front, so that it is not interpreted as being a divisor when glancing over the code.

19 ↗(On Diff #28199)

isProofStateDustThreshold is an incomprehensible name.

This revision now requires changes to proceed.Apr 20 2021, 00:09

What about bool hasDustStake(Proof p);?

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-21T09:19:24.355000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210421_091828/abc_rpc_avalancheproof_625
2021-04-21T09:19:24.663000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-21T09:19:25.075000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-21T09:19:25.082000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-21T09:19:27.077000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-21T09:19:27.129000Z TestFramework (INFO): Stopping nodes
2021-04-21T09:19:27.281000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210421_091828/abc_rpc_avalancheproof_625
2021-04-21T09:19:27.281000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210421_091828/abc_rpc_avalancheproof_625/test_framework.log
2021-04-21T09:19:27.281000Z TestFramework (ERROR): 
2021-04-21T09:19:27.282000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210421_091828/abc_rpc_avalancheproof_625' to consolidate all logs
2021-04-21T09:19:27.282000Z TestFramework (ERROR): 
2021-04-21T09:19:27.282000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-21T09:19:27.282000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-21T09:19:27.283000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-21T09:21:33.663000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210421_091823/abc_rpc_avalancheproof_632
2021-04-21T09:21:34.086000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-21T09:21:34.597000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-21T09:21:34.605000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-21T09:21:42.023000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-21T09:21:42.074000Z TestFramework (INFO): Stopping nodes
2021-04-21T09:21:42.326000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210421_091823/abc_rpc_avalancheproof_632
2021-04-21T09:21:42.326000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210421_091823/abc_rpc_avalancheproof_632/test_framework.log
2021-04-21T09:21:42.326000Z TestFramework (ERROR): 
2021-04-21T09:21:42.326000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210421_091823/abc_rpc_avalancheproof_632' to consolidate all logs
2021-04-21T09:21:42.326000Z TestFramework (ERROR): 
2021-04-21T09:21:42.326000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-21T09:21:42.326000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-21T09:21:42.326000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-21T09:22:43.613000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092008/abc_rpc_avalancheproof_473
2021-04-21T09:22:43.917000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-21T09:22:44.378000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-21T09:22:44.382000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-21T09:22:46.482000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-21T09:22:46.533000Z TestFramework (INFO): Stopping nodes
2021-04-21T09:22:46.835000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092008/abc_rpc_avalancheproof_473
2021-04-21T09:22:46.835000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092008/abc_rpc_avalancheproof_473/test_framework.log
2021-04-21T09:22:46.835000Z TestFramework (ERROR): 
2021-04-21T09:22:46.835000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092008/abc_rpc_avalancheproof_473' to consolidate all logs
2021-04-21T09:22:46.835000Z TestFramework (ERROR): 
2021-04-21T09:22:46.835000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-21T09:22:46.835000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-21T09:22:46.835000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-21T09:25:55.054000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092328/abc_rpc_avalancheproof_209
2021-04-21T09:25:55.421000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-21T09:25:55.988000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-21T09:25:55.991000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-21T09:25:58.091000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-21T09:25:58.142000Z TestFramework (INFO): Stopping nodes
2021-04-21T09:25:58.344000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092328/abc_rpc_avalancheproof_209
2021-04-21T09:25:58.344000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092328/abc_rpc_avalancheproof_209/test_framework.log
2021-04-21T09:25:58.344000Z TestFramework (ERROR): 
2021-04-21T09:25:58.344000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210421_092328/abc_rpc_avalancheproof_209' to consolidate all logs
2021-04-21T09:25:58.344000Z TestFramework (ERROR): 
2021-04-21T09:25:58.345000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-21T09:25:58.345000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-21T09:25:58.345000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py
Bitcoin ABC functional tests with the next upgrade activated: abc_rpc_avalancheproof.py

In D9345#214194, @PiRK wrote:

What about bool hasDustStake(Proof p);?

Yes.

Rebase. The test failures seem unrelated to the revision, and are definitely unrelated to my last amend.

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-22T10:17:03.031000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210422_101615/abc_rpc_avalancheproof_163
2021-04-22T10:17:03.319000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-22T10:17:03.737000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-22T10:17:03.753000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-22T10:17:05.803000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-22T10:17:05.855000Z TestFramework (INFO): Stopping nodes
2021-04-22T10:17:06.157000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210422_101615/abc_rpc_avalancheproof_163
2021-04-22T10:17:06.157000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210422_101615/abc_rpc_avalancheproof_163/test_framework.log
2021-04-22T10:17:06.157000Z TestFramework (ERROR): 
2021-04-22T10:17:06.157000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210422_101615/abc_rpc_avalancheproof_163' to consolidate all logs
2021-04-22T10:17:06.157000Z TestFramework (ERROR): 
2021-04-22T10:17:06.157000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-22T10:17:06.157000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-22T10:17:06.157000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-22T10:18:14.916000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210422_101535/abc_rpc_avalancheproof_609
2021-04-22T10:18:15.414000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-22T10:18:15.925000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-22T10:18:15.934000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-22T10:18:23.131000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-22T10:18:23.182000Z TestFramework (INFO): Stopping nodes
2021-04-22T10:18:23.434000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210422_101535/abc_rpc_avalancheproof_609
2021-04-22T10:18:23.434000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210422_101535/abc_rpc_avalancheproof_609/test_framework.log
2021-04-22T10:18:23.434000Z TestFramework (ERROR): 
2021-04-22T10:18:23.434000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210422_101535/abc_rpc_avalancheproof_609' to consolidate all logs
2021-04-22T10:18:23.434000Z TestFramework (ERROR): 
2021-04-22T10:18:23.434000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-22T10:18:23.434000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-22T10:18:23.434000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-22T10:19:42.375000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_101739/abc_rpc_avalancheproof_482
2021-04-22T10:19:42.701000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-22T10:19:43.119000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-22T10:19:43.136000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-22T10:19:45.304000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-22T10:19:45.357000Z TestFramework (INFO): Stopping nodes
2021-04-22T10:19:45.559000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_101739/abc_rpc_avalancheproof_482
2021-04-22T10:19:45.559000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_101739/abc_rpc_avalancheproof_482/test_framework.log
2021-04-22T10:19:45.559000Z TestFramework (ERROR): 
2021-04-22T10:19:45.559000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_101739/abc_rpc_avalancheproof_482' to consolidate all logs
2021-04-22T10:19:45.559000Z TestFramework (ERROR): 
2021-04-22T10:19:45.559000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-22T10:19:45.559000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-22T10:19:45.559000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-22T10:23:02.138000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_102040/abc_rpc_avalancheproof_571
2021-04-22T10:23:02.482000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-22T10:23:02.901000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-22T10:23:02.917000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-22T10:23:05.021000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 95, in run_test
    assert node.addavalanchenode(peerid1, proof_master, good_proof)
AssertionError
2021-04-22T10:23:05.072000Z TestFramework (INFO): Stopping nodes
2021-04-22T10:23:05.324000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_102040/abc_rpc_avalancheproof_571
2021-04-22T10:23:05.324000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_102040/abc_rpc_avalancheproof_571/test_framework.log
2021-04-22T10:23:05.324000Z TestFramework (ERROR): 
2021-04-22T10:23:05.324000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210422_102040/abc_rpc_avalancheproof_571' to consolidate all logs
2021-04-22T10:23:05.324000Z TestFramework (ERROR): 
2021-04-22T10:23:05.324000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-22T10:23:05.324000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-22T10:23:05.324000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py
Bitcoin ABC functional tests with the next upgrade activated: abc_rpc_avalancheproof.py

TIL that the halvings are different on regtest than on mainnet. I need to work on a fix for the functional test that uses coinbase UTXOs to build a very large proof, because the coinbase amounts are lower than the dust threshold before I can reach 1000 stakes.
The problem did not appear earlier because this revision had not been rebased for a while, and the problematic test did not exist a couple of weeks ago.

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche.py ======

------- Stdout: -------
2021-04-23T07:48:33.829000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210423_074632/abc_p2p_avalanche_279
2021-04-23T07:48:34.158000Z TestFramework (INFO): Check the node is signalling the avalanche service.
2021-04-23T07:48:36.077000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche.py", line 158, in run_test
    stakes = get_stakes(node, [blockhashes[0]], addrkey0.key)
TypeError: get_stakes() takes 2 positional arguments but 3 were given
2021-04-23T07:48:36.128000Z TestFramework (INFO): Stopping nodes
2021-04-23T07:48:36.380000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210423_074632/abc_p2p_avalanche_279
2021-04-23T07:48:36.380000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210423_074632/abc_p2p_avalanche_279/test_framework.log
2021-04-23T07:48:36.380000Z TestFramework (ERROR): 
2021-04-23T07:48:36.380000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210423_074632/abc_p2p_avalanche_279' to consolidate all logs
2021-04-23T07:48:36.381000Z TestFramework (ERROR): 
2021-04-23T07:48:36.381000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-23T07:48:36.381000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-23T07:48:36.381000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche.py ======

------- Stdout: -------
2021-04-23T07:52:32.999000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_p2p_avalanche_285
2021-04-23T07:52:33.312000Z TestFramework (INFO): Check the node is signalling the avalanche service.
2021-04-23T07:52:34.999000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche.py", line 158, in run_test
    stakes = get_stakes(node, [blockhashes[0]], addrkey0.key)
TypeError: get_stakes() takes 2 positional arguments but 3 were given
2021-04-23T07:52:35.050000Z TestFramework (INFO): Stopping nodes
2021-04-23T07:52:35.252000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_p2p_avalanche_285
2021-04-23T07:52:35.252000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_p2p_avalanche_285/test_framework.log
2021-04-23T07:52:35.252000Z TestFramework (ERROR): 
2021-04-23T07:52:35.252000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_p2p_avalanche_285' to consolidate all logs
2021-04-23T07:52:35.252000Z TestFramework (ERROR): 
2021-04-23T07:52:35.252000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-23T07:52:35.252000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-23T07:52:35.252000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-23T07:52:44.722000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_rpc_avalancheproof_302
2021-04-23T07:52:45.022000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-23T07:52:45.440000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-23T07:52:45.455000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-23T07:52:45.603000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 90, in run_test
    too_many_stakes = get_stakes(node, AVALANCHE_MAX_PROOF_STAKES + 1)
  File "/work/test/functional/test_framework/avatools.py", line 67, in get_stakes
    utxos = node.listunspent()
  File "/work/test/functional/test_framework/coverage.py", line 48, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 159, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Method not found (-32601)
2021-04-23T07:52:45.655000Z TestFramework (INFO): Stopping nodes
2021-04-23T07:52:45.859000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_rpc_avalancheproof_302
2021-04-23T07:52:45.859000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_rpc_avalancheproof_302/test_framework.log
2021-04-23T07:52:45.860000Z TestFramework (ERROR): 
2021-04-23T07:52:45.860000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_075200/abc_rpc_avalancheproof_302' to consolidate all logs
2021-04-23T07:52:45.860000Z TestFramework (ERROR): 
2021-04-23T07:52:45.860000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-23T07:52:45.861000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-23T07:52:45.861000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche.py
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche.py ======

------- Stdout: -------
2021-04-23T07:49:34.900000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_074748/abc_p2p_avalanche_560
2021-04-23T07:49:35.222000Z TestFramework (INFO): Check the node is signalling the avalanche service.
2021-04-23T07:49:36.967000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche.py", line 158, in run_test
    stakes = get_stakes(node, [blockhashes[0]], addrkey0.key)
TypeError: get_stakes() takes 2 positional arguments but 3 were given
2021-04-23T07:49:37.018000Z TestFramework (INFO): Stopping nodes
2021-04-23T07:49:37.220000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_074748/abc_p2p_avalanche_560
2021-04-23T07:49:37.221000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_074748/abc_p2p_avalanche_560/test_framework.log
2021-04-23T07:49:37.221000Z TestFramework (ERROR): 
2021-04-23T07:49:37.221000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_074748/abc_p2p_avalanche_560' to consolidate all logs
2021-04-23T07:49:37.222000Z TestFramework (ERROR): 
2021-04-23T07:49:37.222000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-23T07:49:37.222000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-23T07:49:37.222000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche.py ======

------- Stdout: -------
2021-04-23T07:53:00.508000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_075104/abc_p2p_avalanche_228
2021-04-23T07:53:01.148000Z TestFramework (INFO): Check the node is signalling the avalanche service.
2021-04-23T07:53:02.920000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche.py", line 158, in run_test
    stakes = get_stakes(node, [blockhashes[0]], addrkey0.key)
TypeError: get_stakes() takes 2 positional arguments but 3 were given
2021-04-23T07:53:02.971000Z TestFramework (INFO): Stopping nodes
2021-04-23T07:53:03.222000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_075104/abc_p2p_avalanche_228
2021-04-23T07:53:03.222000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_075104/abc_p2p_avalanche_228/test_framework.log
2021-04-23T07:53:03.222000Z TestFramework (ERROR): 
2021-04-23T07:53:03.223000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210423_075104/abc_p2p_avalanche_228' to consolidate all logs
2021-04-23T07:53:03.223000Z TestFramework (ERROR): 
2021-04-23T07:53:03.223000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-23T07:53:03.223000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-23T07:53:03.223000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche.py
Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche.py

Rebase after updating dependency D9441

Failed tests logs:

====== Bitcoin ABC functional tests: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-04-23T08:04:20.963000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_080332/abc_rpc_avalancheproof_566
2021-04-23T08:04:21.256000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-04-23T08:04:21.665000Z TestFramework (INFO): The proof verification should be delayed until IBD is complete
2021-04-23T08:04:21.668000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-04-23T08:04:21.760000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 90, in run_test
    too_many_stakes = get_stakes(node, AVALANCHE_MAX_PROOF_STAKES + 1)
  File "/work/test/functional/test_framework/avatools.py", line 67, in get_stakes
    utxos = node.listunspent()
  File "/work/test/functional/test_framework/coverage.py", line 48, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 159, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Method not found (-32601)
2021-04-23T08:04:21.811000Z TestFramework (INFO): Stopping nodes
2021-04-23T08:04:22.013000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_080332/abc_rpc_avalancheproof_566
2021-04-23T08:04:22.013000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_080332/abc_rpc_avalancheproof_566/test_framework.log
2021-04-23T08:04:22.013000Z TestFramework (ERROR): 
2021-04-23T08:04:22.014000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210423_080332/abc_rpc_avalancheproof_566' to consolidate all logs
2021-04-23T08:04:22.014000Z TestFramework (ERROR): 
2021-04-23T08:04:22.014000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-04-23T08:04:22.014000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-04-23T08:04:22.015000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_rpc_avalancheproof.py

rebase again after fixing the wallet dependency introduced in D9441

This revision is now accepted and ready to land.Apr 23 2021, 10:16
deadalnix requested changes to this revision.Apr 26 2021, 21:03
deadalnix added inline comments.
src/avalanche/test/peermanager_tests.cpp
311 ↗(On Diff #28259)

Is that even a possible score? Wouldn't this mean 100M out of 21M coins are staked?

test/functional/abc_rpc_avalancheproof.py
185 ↗(On Diff #28259)

The amounts are always worked using Decimal in the test suite.

This revision now requires changes to proceed.Apr 26 2021, 21:03

Use Decimal in the functional test.
Use a more plausible stake of 10 million coins in the unit test. The test should still fail less than once every 2 or 3 years if we assume 100 runs per day.

This revision is now accepted and ready to land.Apr 27 2021, 22:15
test/functional/abc_rpc_avalancheproof.py
187 ↗(On Diff #28290)

I would be btter to do the calculation using Decimal, but it's not worth blocking this diff for that.

This revision was automatically updated to reflect the committed changes.