-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: make address field optional list{transactions, sinceblock} response
#26349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
maflcko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Concept ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be random?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it in 670395c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be shorter to just call createrawtransaction '[]' '[{"data":"aa"}]'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in Done in 670395c. Thanks.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
|
Concept ACK. |
670395c to
4b48838
Compare
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach ACK
src/wallet/rpc/transactions.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be helpful to describe in these two changed helps why (in what case) the address wouldn't be returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 078199c245cc475bb594930177fd505d84fede4b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating! The spelling linter doesn't like "ommited"
src/wallet/rpc/transactions.cpp:450: ommited ==> omitted
src/wallet/rpc/transactions.cpp:564: ommited ==> omitted
Maybe something like:
"The bitcoin address of the transaction (not returned if the transaction contains OP_RETURN null data)."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in b725cbe. Thanks for the suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your diff in both test files (see #26257):
| assert('address' not in op_ret_tx) | |
| assert 'address' not in op_ret_tx |
This avoids the python linter raising locally and needing to update #26257
test/functional/wallet_listsinceblock.py:463:15: E275 missing whitespace after keyword
test/functional/wallet_listtransactions.py:297:15: E275 missing whitespace after keyword
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 078199c245cc475bb594930177fd505d84fede4b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your diff in both test files, if you retouch
| raw_tx = self.nodes[0].createrawtransaction([],[{'data':'aa'}]) | |
| raw_tx = self.nodes[0].createrawtransaction([], [{'data': 'aa'}]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 078199c245cc475bb594930177fd505d84fede4b. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in b725cbe. Thanks.
|
ACK modulo two comments |
src/wallet/rpc/transactions.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is true. A scriptpubkey can be nonstandard, but that doesn't imply it has an OP_RETURN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also (unrelated): A transaction does not have an address. At most it is the address of the output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the following message better ?
not returned if the output address cannot be decoded (such as OP_RETURN null data).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "does not have an address" is more correct. "cannot be decoded" implies that there is a correct way to encode addresses in a transaction, but that's not correct as addresses are not encoded into transactions, they are turned into scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in eb679a7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK eb679a7
I was able to verify that this PR fixes the original issue by reproducing the crash on master+mainnet (with --enable-debug) using the following steps:
$ ./src/bitcoind -blockfilterindex
$ ./src/bitcoin-cli -named createwallet wallet_name=26349 disable_private_keys=true
$ ./src/bitcoin-cli -rpcwallet=26349 importdescriptors '[{"desc": "raw(6a20a015693871d8bde65f57ec82f52f6b192e9a11fa26a37e63e17dc3092c6c7fab)#jgvt3p6e", "timestamp": 1516693300}]'
$ ./src/bitcoin-cli -rpcwallet=26349 listtransactions '*' 500
error code: -1
error message:
Internal bug detected: "std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); })"
rpc/util.cpp:587 (HandleRequest)
Please report this issue here: https://github.com/bitcoin/bitcoin/issuesThen on this PR:
$ ./src/bitcoin-cli loadwallet 26349
$ ./src/bitcoin-cli -rpcwallet=26349 listtransactions '*' 500
[
{
"parent_descs": [
"raw(6a20a015693871d8bde65f57ec82f52f6b192e9a11fa26a37e63e17dc3092c6c7fab)#jgvt3p6e"
],
"category": "receive",
"amount": 0.00000000,
"vout": 1,
"confirmations": 254851,
"blockhash": "00000000000000000025a92c80f5c259ca5d9d36d407906dbefbd8075c3ae77b",
"blockheight": 505672,
"blockindex": 857,
"blocktime": 1516693344,
"txid": "b6439e1c9eb3915b3cc89871d2c2479f3f1847f0c7bab252c3ebc503b8f6d344",
"wtxid": "393cfba86cb0d3274850aa461dab433b5d62c1dce68dc10d43de969b8dec2359",
"walletconflicts": [
],
"time": 1516693344,
"timereceived": 1666874521,
"bip125-replaceable": "no"
}
]|
ACK eb679a7 |
…{transactions, sinceblock}` response
eb679a7 rpc: make `address` field optional (w0xlt)
Pull request description:
Close bitcoin/bitcoin#26338.
This PR makes optional the `address` field in the response of `listtransactions` and `listsinceblock` RPC.
And adds two tests that fail on master, but not on this branch.
ACKs for top commit:
achow101:
ACK eb679a7
aureleoules:
ACK eb679a7
Tree-SHA512: b267439626e2ec3134ae790c849949a4c40ef0cebd20092e8187be3db0a61941b2da10bbbba92ca880b8369f46c1aaa806d057eaa5159325f65cbec7cb33c52f
|
For some reason github is not detecting that this was merged. |
|
Post-merge ACK |
Github-Pull: bitcoin#26349 Rebased-From: eb679a7
|
Backported to 24.x in #26410. |
d570190 rpc: make `address` field optional (w0xlt) e4b8c9b rpc: add non-regression test about deriveaddresses crash when index is 2147483647 (muxator) bf2bf73 rpc: fix crash in deriveaddresses when derivation index is 2147483647 (muxator) b04f5f9 test: Test for out of bounds vout in sendall (Andrew Chow) dedee6a wallet: Check utxo prevout index out of bounds in sendall (Andrew Chow) 931db78 test: Test that sendall works with watchonly spending specific utxos (Andrew Chow) bbe864a wallet: Correctly check ismine for sendall (Andrew Chow) 4b7d30d Adjust `.tx/config` for new Transifex CLI (Hennadii Stepanov) Pull request description: Backports: * #26321 * #26344 * #26275 * #26349 ACKs for top commit: instagibbs: ACK d570190 hebasto: ACK d570190, I've cherry-picked commits manually and got zero diff with this PR branch. Tree-SHA512: dad64f4074b4f06d666c0f2d804eda92df241bcce0a49c28486311a151f2e9d46b75e1bce02de570dcc85957c9ce936debb2a4faa045800c9757c6c495115d7c
Close #26338.
This PR makes optional the
addressfield in the response oflisttransactionsandlistsinceblockRPC.And adds two tests that fail on master, but not on this branch.