Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Dec 11, 2024

Issue being fixed or feature implemented

The rpc debug duplicates functionality of RPC logging.
Beside that it has next disadvantages:

  • debug doesn't have any tests
  • debug has our own implementation while logging is supported by mainstream
  • logging can work in both modes "all except..." and "only ...", while debug doesn't have a feature "all except..."

Though, there's particular case when debug is more convenient: if you have several categories it's simplier to write debug X+Y rather than logging "[\"X\", \"Y\"]"

Discovered while doing https://github.com/dashpay/dash-issues/issues/63

What was done?

Deprecated rpc debug.
There's some HowTo for debug users for smooth switch to logging:
For debug all: logging [\"all\"]
For debug none: logging '[]' '["all"]'
For debug X+Y: logging "[\"X\", \"Y\"]"

How Has This Been Tested?

Run unit and functional tests

Breaking Changes

It removes RPC debug

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@knst knst added the RPC Some notable changes to RPC params/behaviour/descriptions label Dec 11, 2024
@knst knst added this to the 23 milestone Dec 11, 2024
@UdjinM6
Copy link

UdjinM6 commented Dec 11, 2024

test  2024-12-11T14:43:28.070000Z TestFramework (INFO): Try running a not whitelisted command as the operator... 
 test  2024-12-11T14:43:28.070000Z TestFramework (ERROR): Assertion failed 
                                   Traceback (most recent call last):
                                     File "/builds/dashpay/dash/build-ci/dashcore-linux64/test/functional/test_framework/test_framework.py", line 161, in main
                                       self.run_test()
                                     File "/builds/dashpay/dash/build-ci/dashcore-linux64/test/functional/rpc_deprecated_platform_filter.py", line 114, in run_test
                                       test_command("debug", ["1"], rpcuser_authpair_operator, 200)
                                     File "/builds/dashpay/dash/build-ci/dashcore-linux64/test/functional/rpc_deprecated_platform_filter.py", line 56, in test_command
                                       assert_equal(resp.status, expected_status)
                                     File "/builds/dashpay/dash/build-ci/dashcore-linux64/test/functional/test_framework/util.py", line 69, in assert_equal
                                       raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
                                   AssertionError: not(500 == 200)

@UdjinM6
Copy link

UdjinM6 commented Dec 11, 2024

also, should be draft for now to avoid merging before v22.1

@knst knst marked this pull request as draft December 11, 2024 15:31
@knst
Copy link
Collaborator Author

knst commented Dec 12, 2024

 test_command("debug", ["1"], rpcuser_authpair_operator, 200)

This failure will be fixed by merging PR after #6482 (removing this functional test)

I will rebase it when v23 will be close enough

@knst knst requested a review from shumkov December 17, 2024 15:35
@knst
Copy link
Collaborator Author

knst commented Dec 17, 2024

@shumkov we are planning to remove debug RPC in favor of logging which has more features and has upstream support by Bitcoin Core.
I heard dashmate calls debug rpc

If you are using command line option -debug=.... it's fine, no changes required

@knst knst mentioned this pull request Mar 12, 2025
5 tasks
@knst
Copy link
Collaborator Author

knst commented Mar 12, 2025

Superseeded by #6612

Lately I noticed that it's not trivial to use logging with more than 1 category such as logging [a, b] due to requirement to escape quotes, inside quotes while debug a+b doesn't require any escaping and easier to type.

@knst knst closed this Mar 12, 2025
@UdjinM6
Copy link

UdjinM6 commented Mar 13, 2025

Though, there's particular case when debug is more convenient: if you have several categories it's simplier to write debug X+Y rather than logging "[\"X\", \"Y\"]"

you could simply use logging '["X", "Y"]' to avoid escaping double quotes

@UdjinM6 UdjinM6 removed this from the 23 milestone Mar 19, 2025
PastaPastaPasta added a commit that referenced this pull request Apr 1, 2025
53000e1 chore: use quotes for CLI example for rpc logging (Konstantin Akimov)
1f0f463 docs: extend doc for rpc 'debug' to mention rpc 'logging' (Konstantin Akimov)
07fefb3 tests: add functional tests for RPC debug (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  See dashpay/dash-issues#63

  ## What was done?
  Functional tests for RPC `debug`. Extended help for this RPC (mentioning of RPC `logging`)

  This PR replaces #6480
  Lately I noticed that it's not trivial to use `logging` with more than 1 category such as `logging [a, b]` due to requirement to escape quotes, inside quotes while `debug a+b` doesn't require any escaping and easier to type.

  ## How Has This Been Tested?
  Run unit / functional tests (by CI)
  ```
  test/functional/test_runner.py -j20 --previous-releases --coverage --extended
  ```

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK 53000e1
  kwvg:
    utACK 53000e1

Tree-SHA512: 4944b9b0476600ee993c25149eb18da485c6817fdffbe242f950dbbff16bc5ecd5ed9ad09935ffd00439c0d248a1b8b87504895faf33debf916eb4e714104e8f
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.

2 participants