Skip to content

Conversation

@andrewtoth
Copy link
Contributor

The verbose mempool json response can get very large. This adds an option to return the non-verbose response of just the txids. It is identical to the rpc response so the diff here is minimal. This also adds the mempool_sequence parameter for rpc consistency. Verbose defaults to true to remain backwards compatible.

It uses query parameters to be compatible with the efforts in #25752.

@glozow glozow requested review from brunoerg, luke-jr and stickies-v and removed request for luke-jr September 30, 2022 11:11
Copy link
Contributor

@brunoerg brunoerg 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

You should update the doc (REST-interface.md) as well

@andrewtoth
Copy link
Contributor Author

You should update the doc (REST-interface.md) as well

@brunoerg would it make sense to update that file after there has been a release with this patch? I think that might confuse users who see those options in the doc but are unable to use them in any release.

@andrewtoth andrewtoth force-pushed the rest-verbose-mempool branch from e462602 to 5a30be2 Compare October 1, 2022 16:45
Copy link
Contributor

@stickies-v stickies-v 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 - bringing it further in line with the getrawmempool RPC seems reasonable.

would it make sense to update that file after there has been a release with this patch?

To minimize maintenance I'd suggest labeling this pull with the 25.0 milestone and adding a small disclaimer to the rest-interface.md documentation that these 2 parameters are available only from 25.0, similar to

*Deprecated (but not removed) since 24.0:*

That way when this PR doesn't make it into 25.0 it'll be easy to track and update the docs.

src/rest.cpp Outdated
Comment on lines 612 to 618
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the most elegant solution here would be to introduce a HTTPRequest::GetQueryParameter<bool> specialization that converts to and returns a bool, or throws an err if the string can't be parsed. However, that would require some more fundamental changes to how we deal with errors (which unfortunately we return instead of throw) here. Flagging it here for follow-up, feel free to grab it if you're keen.

Copy link
Contributor

Choose a reason for hiding this comment

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

Strong concept ACK on introducing a HTTPRequest::GetQueryParameter<bool>, it would be more elegant than using string ("true"/"false"), but I know it would require a lot of more work and maybe could be done in a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can definitely do that in a follow-up PR after this is merged.

@andrewtoth andrewtoth force-pushed the rest-verbose-mempool branch from fd4c6dc to c35c7d0 Compare October 4, 2022 03:33
@andrewtoth
Copy link
Contributor Author

I'd suggest labeling this pull with the 25.0 milestone

@stickies-v I don't think I have permissions to add labels. Otherwise I have addressed all feedback from yourself and @brunoerg .

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

ACK c35c7d091 (for 25.0)

I don't think I have permissions to add labels.

The maintainers should be able to add the 25.0 label when they see this, otherwise you can always send a message on #bitcoin-core-dev IRC. It's not super urgent though, just would be a bit easier to track I think.

@andrewtoth andrewtoth force-pushed the rest-verbose-mempool branch from c35c7d0 to b534c54 Compare October 4, 2022 12:37
@andrewtoth andrewtoth force-pushed the rest-verbose-mempool branch from b534c54 to 8cc41a1 Compare October 4, 2022 13:19
@stickies-v
Copy link
Contributor

Can you please rebase to latest master to unblock the (unrelated) failing Win64 CI test?

@andrewtoth andrewtoth force-pushed the rest-verbose-mempool branch from 8cc41a1 to 1ff5d61 Compare October 5, 2022 13:26
Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

re-ACK 1ff5d61

I verified that the only changes since c35c7d0 are suggested documentation updates to REST-interface.md.

Copy link
Member

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

tested ACK 1ff5d61.

I've performed manual tests getting the node started with -rest, comparing results between the rest api call using curl with the different combinations of params and values vs. calling the getrawtransacion rpc command (using bitcoin-cli), which is essentially what the python functional tests do.

It works as expected and it's consistent with rpc.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 10, 2023

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK stickies-v, pablomartin4btc, achow101
Concept ACK brunoerg

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

@achow101
Copy link
Member

ACK 1ff5d61

@achow101 achow101 merged commit ebb15ea into bitcoin:master Mar 15, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 16, 2023
…ams for mempool/contents

1ff5d61 doc: add mempool/contents rest verbose and mempool_sequence args (Andrew Toth)
52a31dc tests: mempool/contents verbose and mempool_sequence query params tests (Andrew Toth)
a518fff rest: add verbose and mempool_sequence query params for mempool/contents (Andrew Toth)

Pull request description:

  The verbose mempool json response can get very large. This adds an option to return the non-verbose response of just the txids. It is identical to the rpc response so the diff here is minimal. This also adds the mempool_sequence parameter for rpc consistency. Verbose defaults to true to remain backwards compatible.

  It uses query parameters to be compatible with the efforts in bitcoin#25752.

ACKs for top commit:
  achow101:
    ACK 1ff5d61
  stickies-v:
    re-ACK [1ff5d61](bitcoin@1ff5d61)
  pablomartin4btc:
    tested ACK 1ff5d61.

Tree-SHA512: 1bf08a7ffde2e7db14dc746e421feedf17d84c4b3f1141e79e36feb6014811dfde80e1d8dbc476c15ff705de2d3c967b3081dcd80536d76b7edf888f1a92e9d1
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 16, 2023
…ams for mempool/contents

1ff5d61 doc: add mempool/contents rest verbose and mempool_sequence args (Andrew Toth)
52a31dc tests: mempool/contents verbose and mempool_sequence query params tests (Andrew Toth)
a518fff rest: add verbose and mempool_sequence query params for mempool/contents (Andrew Toth)

Pull request description:

  The verbose mempool json response can get very large. This adds an option to return the non-verbose response of just the txids. It is identical to the rpc response so the diff here is minimal. This also adds the mempool_sequence parameter for rpc consistency. Verbose defaults to true to remain backwards compatible.

  It uses query parameters to be compatible with the efforts in bitcoin#25752.

ACKs for top commit:
  achow101:
    ACK 1ff5d61
  stickies-v:
    re-ACK [1ff5d61](bitcoin@1ff5d61)
  pablomartin4btc:
    tested ACK 1ff5d61.

Tree-SHA512: 1bf08a7ffde2e7db14dc746e421feedf17d84c4b3f1141e79e36feb6014811dfde80e1d8dbc476c15ff705de2d3c967b3081dcd80536d76b7edf888f1a92e9d1
@bitcoin bitcoin deleted a comment from jamesmichaeltate1 Mar 16, 2023
@andrewtoth andrewtoth deleted the rest-verbose-mempool branch June 6, 2023 15:14
@bitcoin bitcoin locked and limited conversation to collaborators Jun 5, 2024
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.

6 participants