Skip to content

doc: Explain in the generate* RPC docs that they are only for testing - #24028

Closed
sipa wants to merge 1 commit into
bitcoin:masterfrom
sipa:202201_rpcmining_lol_no
Closed

sipa wants to merge 1 commit into
bitcoin:masterfrom
sipa:202201_rpcmining_lol_no

Conversation

@sipa

@sipa sipa commented Jan 11, 2022

Copy link
Copy Markdown
Member

No description provided.

@fanquake fanquake added the Docs label Jan 11, 2022
@fanquake fanquake linked an issue Jan 11, 2022 that may be closed by this pull request
@sipa sipa mentioned this pull request Jan 11, 2022
@fjahr

fjahr commented Jan 11, 2022

Copy link
Copy Markdown
Contributor

ACK e187e0e

@w0xlt w0xlt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK e187e0e

@DrahtBot

DrahtBot commented Jan 11, 2022 •

Copy link
Copy Markdown
Contributor

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #24137 (doc: Rework generate* doc by MarcoFalke)
  • #18933 (rpc: Add submit option to generateblock by MarcoFalke)

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.

@ghost ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ACK e187e0e

This PR improves documentation for generateblock generatetoaddress generatetodescriptor RPC and fixes #24027

@maflcko maflcko changed the title Explain in the generate* RPC docs that they are only for testing doc: Explain in the generate* RPC docs that they are only for testing Jan 11, 2022

@maflcko maflcko left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No objection to updating the docs, but I think the real issue is that the docs aren't hidden. For some reason no one ever removed them from the rpc help overview. I'd suggest to do that instead.

And once the RPCs are hidden, I think we can assume that anyone reading their help text understand POW. So a very brief "testing only because ridiculously inefficient" is enough.

Comment thread src/rpc/mining.cpp
return RPCHelpMan{
"generatetodescriptor",
"\nMine blocks immediately to a specified descriptor (before the RPC call returns)\n",
"\nMine blocks immediately to a specified descriptor (before the RPC call returns)\n"

@maflcko maflcko Jan 11, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"\nMine blocks immediately to a specified descriptor (before the RPC call returns)\n"
"Mine blocks immediately to a specified descriptor (before the RPC call returns)\n"

While touching this, there is no need to keep the \ns in the beginning and end. See https://github.com/bitcoin/bitcoin/pull/23714/files

@jonatack jonatack Jan 11, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestions for each of these helps

  • period at end of sentences
  • shorten the longer line
  • maybe wrap maxtries with backticks
  • omit newlines at start and end (as mentioned by Marco)
-        "\nMine blocks immediately to a specified descriptor (before the RPC call returns)\n"
-        "Only maxtries hash attempts will be performed. If no valid block can be found among those,\n"
-        "an error will be returned. This RPC is only intended for testing purposes, as it is highly inefficient and extremely\n"
-        "unlikely to succeed on mainnet\n",
+        "Mine blocks immediately to a specified descriptor (before the RPC call returns).\n"
+        "Only `maxtries` hash attempts will be performed. If no valid block can be found among those,\n"
+        "an error will be returned. This RPC is only intended for testing purposes, as it is highly\n"
+        "inefficient and extremely unlikely to succeed on mainnet.",

output

Mine blocks immediately to a specified descriptor (before the RPC call returns).
Only `maxtries` hash attempts will be performed. If no valid block can be found among those,
an error will be returned. This RPC is only intended for testing purposes, as it is highly
inefficient and extremely unlikely to succeed on mainnet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this turns into a pull to rework the docs, the "immediately" and "(before the RPC call returns)" can be removed. It should be clear from the return value (the block hash) that the block was generated before the has was returned.

@laanwj

laanwj commented Jan 13, 2022

Copy link
Copy Markdown
Member

Concept ACK

1 similar comment
@theStack

Copy link
Copy Markdown
Contributor

Concept ACK

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docs in this pull aren't exactly right (no error will be returned). I've created a conflicting pull in #24137 due to inactivity here. Feel free to cherry-pick or rebase on that one.

Comment thread src/rpc/mining.cpp
"\nMine blocks immediately to a specified descriptor (before the RPC call returns)\n",
"\nMine blocks immediately to a specified descriptor (before the RPC call returns)\n"
"Only maxtries hash attempts will be performed. If no valid block can be found among those,\n"
"an error will be returned. This RPC is only intended for testing purposes, as it is highly inefficient and extremely\n"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: This is wrong

Suggested change
"an error will be returned. This RPC is only intended for testing purposes, as it is highly inefficient and extremely\n"
"an empty array will be returned. This RPC is only intended for testing purposes, as it is highly inefficient and extremely\n"

@DrahtBot

Copy link
Copy Markdown
Contributor

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

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@maflcko

maflcko commented Feb 21, 2022

Copy link
Copy Markdown
Member

@sipa Are you still working on this?

@maflcko

maflcko commented Feb 25, 2022

Copy link
Copy Markdown
Member

Closing for now, but this can be reopened anytime (or a new pull can be created).

@maflcko maflcko closed this Feb 25, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Feb 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Deleted]

9 participants