mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 15:08:38 +00:00
rpc: require a hex string for OP_RETURN data #36978
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36978
Loading…
Reference in a new issue
No description provided.
Delete branch "l0rinc/rpc-data-requires-hex-string"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem:
createrawtransactionaccepts a JSON number asdatawhen its digits form valid hex. For example, it treats99as the string"99"and writes the byte0x99to the output.Fix: Pass the original JSON value to the hex parser so it can enforce the documented string type.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
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.
lgtm ACK
f0518a30afThis typo also caused a full copy of the hex string again (not that it matters)
ACK
f0518a30afFor a non-string type, this now fails with
Data must be hexadecimal string (not ''). Seems better to alignParseHexVwithParseHashVand more explicitly fail when an incorrect type is passed?git diff on
f0518a30afI wondered about this too. I guess there is no caller that let's None->"" (empty string) -> b'' (empty hex)
Maybe in a follow-up?
🔵 Suggestion · Numeric
dataerrors display an empty valueA numeric
datavalue such as99is correctly rejected, but the diagnosticData must be hexadecimal string (not '')misleadingly displays an empty string instead of identifying the wrong JSON type.Location:
src/rpc/rawtransaction_util.cpp:128(head).🔵 Suggestion · Numeric
datarejection has no RPC release noteRPCs now reject numeric
datapreviously accepted as hex, despite the existing string-only documentation; a short release note would explain the change, although no current client relying on numeric input was found.Location:
src/rpc/rawtransaction_util.cpp:128(head).Reviewed:
f0518a30afb2· Review report · Previous reportspermalink
lgtm ACK
f0518a30afrfm?