Page MenuHomePhabricator

[avalanche] Improve error messages from the addavalanchenode RPC
ClosedPublic

Authored by Fabien on Jul 15 2021, 14:21.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC7c011fd2a101: [avalanche] Improve error messages from the addavalanchenode RPC
Summary

Rather than returning false, it is possible to raise an error with a meaningful message.

Depends on D9792 and D9794.

Ref T1635.

Test Plan
./test/functional/test_runner.py abc_rpc_addavalanchenode

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_addavalanchenode_proof_state
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16194
Build 32261: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang
Build 32260: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Jul 15 2021, 14:21

Failed tests logs:

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

------- Stdout: -------
2021-07-15T14:30:51.357000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210715_142828/abc_rpc_avalancheproof_29
2021-07-15T14:30:52.606000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-07-15T14:30:52.611000Z TestFramework (INFO): Test decodeavalancheproof RPC
2021-07-15T14:30:53.269000Z TestFramework (INFO): The proof is registered at first chaintip update
2021-07-15T14:30:53.273000Z TestFramework (INFO): Start a node with an orphan proof
2021-07-15T14:30:53.781000Z TestFramework (INFO): Connect to an up-to-date node to unorphan the proof
2021-07-15T14:30:54.849000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-07-15T14:31:03.250000Z TestFramework (INFO): A proof using too many stakes should be rejected...
2021-07-15T14:31:03.686000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 165, in run_test
    peerid2, proof_master, too_many_utxos)
  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: The proof is invalid: too-many-utxos, 1001 > 1000 (-8)
2021-07-15T14:31:03.737000Z TestFramework (INFO): Stopping nodes
2021-07-15T14:31:04.040000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210715_142828/abc_rpc_avalancheproof_29
2021-07-15T14:31:04.040000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210715_142828/abc_rpc_avalancheproof_29/test_framework.log
2021-07-15T14:31:04.040000Z TestFramework (ERROR): 
2021-07-15T14:31:04.040000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210715_142828/abc_rpc_avalancheproof_29' to consolidate all logs
2021-07-15T14:31:04.040000Z TestFramework (ERROR): 
2021-07-15T14:31:04.040000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-15T14:31:04.040000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-15T14:31:04.040000Z 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-07-15T14:33:06.676000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143116/abc_rpc_avalancheproof_29
2021-07-15T14:33:07.241000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-07-15T14:33:07.244000Z TestFramework (INFO): Test decodeavalancheproof RPC
2021-07-15T14:33:07.656000Z TestFramework (INFO): The proof is registered at first chaintip update
2021-07-15T14:33:07.665000Z TestFramework (INFO): Start a node with an orphan proof
2021-07-15T14:33:07.935000Z TestFramework (INFO): Connect to an up-to-date node to unorphan the proof
2021-07-15T14:33:08.998000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-07-15T14:33:11.387000Z TestFramework (INFO): A proof using too many stakes should be rejected...
2021-07-15T14:33:11.584000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 165, in run_test
    peerid2, proof_master, too_many_utxos)
  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: The proof is invalid: too-many-utxos, 1001 > 1000 (-8)
2021-07-15T14:33:11.635000Z TestFramework (INFO): Stopping nodes
2021-07-15T14:33:11.987000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143116/abc_rpc_avalancheproof_29
2021-07-15T14:33:11.987000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143116/abc_rpc_avalancheproof_29/test_framework.log
2021-07-15T14:33:11.987000Z TestFramework (ERROR): 
2021-07-15T14:33:11.987000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143116/abc_rpc_avalancheproof_29' to consolidate all logs
2021-07-15T14:33:11.987000Z TestFramework (ERROR): 
2021-07-15T14:33:11.987000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-15T14:33:11.987000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-15T14:33:11.987000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc_rpc_avalancheproof.py ======

------- Stdout: -------
2021-07-15T14:36:37.456000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143439/abc_rpc_avalancheproof_29
2021-07-15T14:36:38.375000Z TestFramework (INFO): Make build a valid proof and restart the node to use it
2021-07-15T14:36:38.378000Z TestFramework (INFO): Test decodeavalancheproof RPC
2021-07-15T14:36:38.934000Z TestFramework (INFO): The proof is registered at first chaintip update
2021-07-15T14:36:38.936000Z TestFramework (INFO): Start a node with an orphan proof
2021-07-15T14:36:39.191000Z TestFramework (INFO): Connect to an up-to-date node to unorphan the proof
2021-07-15T14:36:40.253000Z TestFramework (INFO): A proof using the maximum number of stakes is accepted...
2021-07-15T14:36:42.713000Z TestFramework (INFO): A proof using too many stakes should be rejected...
2021-07-15T14:36:42.905000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_avalancheproof.py", line 165, in run_test
    peerid2, proof_master, too_many_utxos)
  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: The proof is invalid: too-many-utxos, 1001 > 1000 (-8)
2021-07-15T14:36:42.956000Z TestFramework (INFO): Stopping nodes
2021-07-15T14:36:43.308000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143439/abc_rpc_avalancheproof_29
2021-07-15T14:36:43.308000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143439/abc_rpc_avalancheproof_29/test_framework.log
2021-07-15T14:36:43.309000Z TestFramework (ERROR): 
2021-07-15T14:36:43.309000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210715_143439/abc_rpc_avalancheproof_29' to consolidate all logs
2021-07-15T14:36:43.309000Z TestFramework (ERROR): 
2021-07-15T14:36:43.309000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-15T14:36:43.309000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-15T14:36:43.309000Z 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

Fabien planned changes to this revision.Jul 15 2021, 14:40

Rebase on top of D9794 to fix the issue

This revision is now accepted and ready to land.Jul 15 2021, 15:23