Page MenuHomePhabricator

rpc: Update server to use new RPCHelpMan
ClosedPublic

Authored by PiRK on Sep 1 2021, 11:56.

Details

Reviewers
majcosta
Fabien
Group Reviewers
Restricted Project
Commits
rABCc6a3bec649b9: rpc: Update server to use new RPCHelpMan
Summary

Also, move Check to inside HandleRequest

This is a backport of core#19386
https://github.com/bitcoin/bitcoin/pull/19386/commits/fa7592bfa8691eb0289b21da3571709a18391b0f

Depends on D10009

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Sep 1 2021, 11:56

Failed tests logs:

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

------- Stdout: -------
2021-09-01T12:20:26.885000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210901_121543/rpc_help_149
2021-09-01T12:20:27.450000Z TestFramework (ERROR): Assertion failed
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/rpc_help.py", line 19, in run_test
    self.test_categories()
  File "/work/test/functional/rpc_help.py", line 28, in test_categories
    assert_raises_rpc_error(-1, 'help', node.help, 'foo', 'bar')
  File "/work/test/functional/test_framework/util.py", line 137, in assert_raises_rpc_error
    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
AssertionError: No exception raised
2021-09-01T12:20:27.501000Z TestFramework (INFO): Stopping nodes
2021-09-01T12:20:27.703000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210901_121543/rpc_help_149
2021-09-01T12:20:27.703000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210901_121543/rpc_help_149/test_framework.log
2021-09-01T12:20:27.703000Z TestFramework (ERROR): 
2021-09-01T12:20:27.703000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210901_121543/rpc_help_149' to consolidate all logs
2021-09-01T12:20:27.703000Z TestFramework (ERROR): 
2021-09-01T12:20:27.703000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-09-01T12:20:27.703000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-09-01T12:20:27.703000Z TestFramework (ERROR):

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

Failed tests logs:

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

------- Stdout: -------
2021-09-01T12:20:46.130000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210901_121921/rpc_help_149
2021-09-01T12:20:46.403000Z TestFramework (ERROR): Assertion failed
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/rpc_help.py", line 19, in run_test
    self.test_categories()
  File "/work/test/functional/rpc_help.py", line 28, in test_categories
    assert_raises_rpc_error(-1, 'help', node.help, 'foo', 'bar')
  File "/work/test/functional/test_framework/util.py", line 137, in assert_raises_rpc_error
    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
AssertionError: No exception raised
2021-09-01T12:20:46.453000Z TestFramework (INFO): Stopping nodes
2021-09-01T12:20:46.554000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210901_121921/rpc_help_149
2021-09-01T12:20:46.555000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210901_121921/rpc_help_149/test_framework.log
2021-09-01T12:20:46.555000Z TestFramework (ERROR): 
2021-09-01T12:20:46.555000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210901_121921/rpc_help_149' to consolidate all logs
2021-09-01T12:20:46.555000Z TestFramework (ERROR): 
2021-09-01T12:20:46.555000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-09-01T12:20:46.555000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-09-01T12:20:46.555000Z TestFramework (ERROR):

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

majcosta requested changes to this revision.Sep 1 2021, 12:24
majcosta added a subscriber: majcosta.

tests

This revision now requires changes to proceed.Sep 1 2021, 12:25

Failed tests logs:

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

------- Stdout: -------
2021-09-01T12:23:11.765000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_121948/rpc_help_149
2021-09-01T12:23:12.935000Z TestFramework (ERROR): Assertion failed
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/rpc_help.py", line 19, in run_test
    self.test_categories()
  File "/work/test/functional/rpc_help.py", line 28, in test_categories
    assert_raises_rpc_error(-1, 'help', node.help, 'foo', 'bar')
  File "/work/test/functional/test_framework/util.py", line 137, in assert_raises_rpc_error
    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
AssertionError: No exception raised
2021-09-01T12:23:12.986000Z TestFramework (INFO): Stopping nodes
2021-09-01T12:23:13.740000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_121948/rpc_help_149
2021-09-01T12:23:13.740000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_121948/rpc_help_149/test_framework.log
2021-09-01T12:23:13.741000Z TestFramework (ERROR): 
2021-09-01T12:23:13.741000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_121948/rpc_help_149' to consolidate all logs
2021-09-01T12:23:13.742000Z TestFramework (ERROR): 
2021-09-01T12:23:13.742000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-09-01T12:23:13.742000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-09-01T12:23:13.743000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: rpc_help.py ======

------- Stdout: -------
2021-09-01T12:26:47.733000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_122317/rpc_help_149
2021-09-01T12:26:48.021000Z TestFramework (ERROR): Assertion failed
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/rpc_help.py", line 19, in run_test
    self.test_categories()
  File "/work/test/functional/rpc_help.py", line 28, in test_categories
    assert_raises_rpc_error(-1, 'help', node.help, 'foo', 'bar')
  File "/work/test/functional/test_framework/util.py", line 137, in assert_raises_rpc_error
    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
AssertionError: No exception raised
2021-09-01T12:26:48.071000Z TestFramework (INFO): Stopping nodes
2021-09-01T12:26:48.273000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_122317/rpc_help_149
2021-09-01T12:26:48.273000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_122317/rpc_help_149/test_framework.log
2021-09-01T12:26:48.273000Z TestFramework (ERROR): 
2021-09-01T12:26:48.273000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210901_122317/rpc_help_149' to consolidate all logs
2021-09-01T12:26:48.273000Z TestFramework (ERROR): 
2021-09-01T12:26:48.273000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-09-01T12:26:48.273000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-09-01T12:26:48.273000Z TestFramework (ERROR):

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

PiRK planned changes to this revision.EditedSep 1 2021, 12:36

bitcoin-cli help now causes a Segmentation fault when called without an argument.
getrpcinfo, stop and uptime still work.

I'm still not sure what is happening, except that help() seems be called recursively and crashes after the 4047th call..

PiRK edited the summary of this revision. (Show Details)

it was missing an important line: add Check(request); in HandleRequest

Fabien requested changes to this revision.Sep 9 2021, 13:46
Fabien added a subscriber: Fabien.

This diff depends on itself.

This revision now requires changes to proceed.Sep 9 2021, 13:46
PiRK requested review of this revision.Sep 9 2021, 13:53
PiRK edited the summary of this revision. (Show Details)

I fixed the dependency in the description

This revision is now accepted and ready to land.Sep 9 2021, 18:13
This revision was automatically updated to reflect the committed changes.