Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jul 22, 2024

The error messages should never happen in normal operation. However, if
they do, they are helpful to return to the user to debug the issue. For
example, to notice a truncated file.

This fixes #28621

Also includes a minor refactor commit.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 22, 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
ACK ryanofsky, fjahr
Concept ACK Sjors
Stale ACK danielabrozzoni

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:

  • #29641 (scripted-diff: Use LogInfo/LogDebug over LogPrintf/LogPrint by maflcko)

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.

@DrahtBot DrahtBot changed the title rpc: Return precise loadtxoutset error messages rpc: Return precise loadtxoutset error messages Jul 22, 2024
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Debug: https://github.com/bitcoin/bitcoin/runs/27742334614

Hints

Make sure to run all tests locally, according to the documentation.

The failure may happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@fjahr
Copy link
Contributor

fjahr commented Jul 22, 2024

Concept ACK

I think the title is a bit confusing here. It sounds like the error message content changes but they are just moved from logs to RPC. I think the title of the the issue that is fixed is a better description.

@maflcko maflcko changed the title rpc: Return precise loadtxoutset error messages rpc: Return errors in loadtxoutset that currently go to logs Jul 22, 2024
@DrahtBot DrahtBot changed the title rpc: Return errors in loadtxoutset that currently go to logs rpc: Return errors in loadtxoutset that currently go to logs Jul 22, 2024
@maflcko
Copy link
Member Author

maflcko commented Jul 22, 2024

I think the title is a bit confusing here. It sounds like the error message content changes but they are just moved from logs to RPC. I think the title of the the issue that is fixed is a better description.

Good point, fixed!

Copy link
Contributor

@danielabrozzoni danielabrozzoni left a comment

Choose a reason for hiding this comment

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

ACK fa5c253 - code looks good to me, tests are passing locally, but I didn't do any manual testing.

@DrahtBot DrahtBot requested a review from fjahr July 23, 2024 14:44
@maflcko maflcko requested a review from Sjors July 23, 2024 16:12
@Sjors
Copy link
Member

Sjors commented Jul 23, 2024

Concept ACK

The message is not exposed in the GUI or another translated context, so
translating it is useless for now.

Also, fix a nit from bitcoin#30395 (comment)
@maflcko maflcko force-pushed the 2407-loadtxoutset-rpc-err branch from fa5c253 to fa91404 Compare July 25, 2024 11:27
@maflcko
Copy link
Member Author

maflcko commented Jul 25, 2024

Rebased. Should be trivial to re-ACK with git range-diff bitcoin-core/master fa5c253b4e fa91404c68

@danielabrozzoni
Copy link
Contributor

re-ACK fa91404

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK fa91404. Nice change which should make RPC errors easier to understand.

The error messages should never happen in normal operation. However, if
they do, they are helpful to return to the user to debug the issue. For
example, to notice a truncated file.
@maflcko maflcko force-pushed the 2407-loadtxoutset-rpc-err branch from fa91404 to fa530ec Compare July 26, 2024 12:11
@maflcko
Copy link
Member Author

maflcko commented Jul 26, 2024

Force pushed to adjust three error messages slightly. Should be easy to re-ACK

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK fa530ec, just adjusting error messages a little since last review. (Thanks!)

@DrahtBot DrahtBot requested a review from danielabrozzoni July 26, 2024 14:26
@fjahr
Copy link
Contributor

fjahr commented Jul 30, 2024

Code review ACK fa530ec

@maflcko
Copy link
Member Author

maflcko commented Aug 5, 2024

rfm, or does it need more review?

@ryanofsky
Copy link
Contributor

rfm, or does it need more review?

Looks good to me. I'd tend to wait for 3 current acks on a change to validation.cpp, but in this case there are two current acks and only string changes since that last stale ack so this seem close enough. Will merge soon.

@ryanofsky ryanofsky merged commit 69df012 into bitcoin:master Aug 5, 2024
16 checks passed
@maflcko maflcko deleted the 2407-loadtxoutset-rpc-err branch August 7, 2024 09:27
@bitcoin bitcoin locked and limited conversation to collaborators Aug 7, 2025
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.

rpc: loadtxoutset should return errors that currently go to logs
6 participants