Skip to content

Conversation

@BrandonOdiwuor
Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor commented Feb 5, 2024

Fixes #27593

Currently, the RPC coverage check in functional tests doesn't include a list of all RPCs. This fix enables wallet RPCs to be included in the rpc_interface.txt used in the coverage check

This PR Reverses part of the changes on PR #16042 - Commit fa47330#diff-4a04bc0b355c780033960e8c261ee9b6d3c452897e1dcd88a15d272512266c76R486 to speed up cache_creation by disabling the wallet

Update:

  • I have added basic abortrescan RPC test (commit - eb085603af2a5da954cf7f95c7f77e173585e878) to fix the failing CI due to no coverage

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 5, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK epiccurious, hernanmarino
Stale ACK maflcko

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29335 (test: Handle functional test disk-full error by BrandonOdiwuor)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko
Copy link
Member

maflcko commented Feb 6, 2024

Also, it doesn't seem to work, because the CI should fail, because the abortrescan rpc is uncovered

@BrandonOdiwuor
Copy link
Contributor Author

@maflcko this is because self.options.descriptors == None in TestNode(... , descriptors=self.options.descriptors, ...) hence the disable_wallet flag is added when the TestNode is instantiated disabling the wallet RPCs just before the first start_node() is invoked

if self.descriptors is None:
self.args.append("-disablewallet")

@BrandonOdiwuor BrandonOdiwuor marked this pull request as ready for review February 6, 2024 15:44
@BrandonOdiwuor BrandonOdiwuor force-pushed the test-coverage branch 2 times, most recently from 6bd9b0d to 9e28a83 Compare February 7, 2024 12:12
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

Thanks. lgtm

Copy link

@jo-elimu jo-elimu left a comment

Choose a reason for hiding this comment

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

@BrandonOdiwuor There is a CI error:

Uncovered RPC commands:
  - abortrescan

@BrandonOdiwuor
Copy link
Contributor Author

@jo-elimu that's the error the fix was to catch. Check the issue

@maflcko
Copy link
Member

maflcko commented Feb 8, 2024

In any case, a pull request with a failing CI can not be merged. Someone will need to add coverage for the RPC, here, or in a different pull.

@epiccurious
Copy link
Contributor

Concept ACK 7dc0442ff5013827c051c8ff50c8fd8aa9440d7c.

@BrandonOdiwuor BrandonOdiwuor force-pushed the test-coverage branch 2 times, most recently from 4b20939 to 7d98e07 Compare February 10, 2024 08:33
@BrandonOdiwuor
Copy link
Contributor Author

@maflcko I have added a basic test for the abortrescan RPC and TODO for adding a test when rescanblockchain is running

I cannot add the second test since I'm unable to get abortrescan to execute when a rescan is ongoing
Screenshot from 2024-02-10 11-39-11

@BrandonOdiwuor
Copy link
Contributor Author

@fanquake fixed by disabling --descriptors flag when running create_cache.py if --legacy-wallet flag is provided

@maflcko
Copy link
Member

maflcko commented Feb 21, 2024

Can you test what happens when the wallet is completely disabled in configure?

@BrandonOdiwuor
Copy link
Contributor Author

@maflcko When wallet is disabled these RPS are reported as uncovered;

Screenshot from 2024-02-22 09-26-27

@maflcko
Copy link
Member

maflcko commented Feb 22, 2024

Why would they? If the RPCs are not compiled into the binary, how would the test know they exist?

@BrandonOdiwuor
Copy link
Contributor Author

@maflcko I was responding to this request

Can you test what happens when the wallet is completely disabled in configure?
#29387 (comment)

Copy link
Contributor

@hernanmarino hernanmarino left a comment

Choose a reason for hiding this comment

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

Concept ACK , but still a little concerned about @maflcko last comment ( #29387 (comment) )

@maflcko
Copy link
Member

maflcko commented Apr 18, 2024

I just tried this myself with --disable-wallet, then call help, and the wallet RPCs were not printed. write_all_rpc_commands also uses help(), so I wonder how you achieved this outcome.

@BrandonOdiwuor
Copy link
Contributor Author

@maflcko @hernanmarino sorry I misunderstood #29387 (comment) earlier

When the wallet is disabled in the configure, the wallet RPCs are not included in the rpc_interface.txt list, hence not part of the coverage check

(example below from my test)
rpc_interface.txt

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@DrahtBot
Copy link
Contributor

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@fanquake
Copy link
Member

Picked up in #33064.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: RPC coverage check doesn't work?

7 participants