-
Notifications
You must be signed in to change notification settings - Fork 37.8k
rpc: show P2(W)SH redeemScript in getrawtransaction #27637 #27638
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
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process. |
@Riahiamirreza are you still working on this? |
@pinheadmz Yes, but I have some difficulties in creating a transaction which spends from a P2SH to be able to view the structure of the transaction. |
There are some hints in https://gist.github.com/pinheadmz/2e85bbdd1b21ed2946f84a88d38f172a |
Are you still working on this? |
@MarcoFalke Actually in the last couple of weeks I didn't put effort on it. If you think this is not critical and can be delayed more, I need more time to spend on it. I know it's somewhat a basic issue in the Bitcoin core, but it's my first issue. |
I'm fixing tests. |
Fixing the test is hopefully a matter of just adding the new field(s) to these tests. Also make sure to squash your commits. |
@Sjors Do you have any suggestion to make the code more cleaner? I think it's not a convenient way to call |
Indeed it's not. But I don't understand what you're trying to do here. I would suggest first fixing the tests, so that it's clear if the code is correct. And then worry about making the code nicer. |
@Sjors For adding new field to a transaction (in my case, adding |
a533fe3
to
146e8da
Compare
@Riahiamirreza You cannot modify |
@sipa Yes and I'm not sure how should I fix the problem. Actually the |
Fix what? Without any information, there is nothing we can do here. If you want to fix the tests, make sure to revert the test changes and run the test locally. |
I don't see why you'd need to make changes to the test framework at all. |
@sipa @maflcko I added new field to the output of |
@maflcko Sure, I'll revert my changes on test framework and then try another way to fix tests. |
146e8da
to
753e007
Compare
feature_bip68_sequence.py | ✖ Failed | 1 s
feature_cltv.py | ✖ Failed | 1 s
feature_coinstatsindex.py | ✖ Failed | 2 s
feature_config_args.py | ✖ Failed | 10 s
feature_csv_activation.py | ✖ Failed | 1 s
feature_dersig.py | ✖ Failed | 1 s
feature_fee_estimation.py | ✖ Failed | 1 s
feature_init.py | ✖ Failed | 63 s
feature_nulldummy.py | ✖ Failed | 1 s
feature_rbf.py | ✖ Failed | 1 s
feature_utxo_set_hash.py | ✖ Failed | 1 s
interface_rest.py | ✖ Failed | 1 s
mempool_accept.py | ✖ Failed | 1 s
mempool_datacarrier.py | ✖ Failed | 1 s
mempool_dust.py | ✖ Failed | 1 s
mempool_expiry.py | ✖ Failed | 1 s
mempool_limit.py | ✖ Failed | 1 s
mempool_package_limits.py | ✖ Failed | 1 s
mempool_package_onemore.py | ✖ Failed | 1 s
mempool_packages.py | ✖ Failed | 1 s
mempool_persist.py --descriptors | ✖ Failed | 1 s
mempool_reorg.py | ✖ Failed | 1 s
mempool_resurrect.py | ✖ Failed | 1 s
mempool_sigoplimit.py | ✖ Failed | 1 s
mempool_spend_coinbase.py | ✖ Failed | 1 s
mempool_unbroadcast.py | ✖ Failed | 7 s
mempool_updatefromblock.py | ✖ Failed | 1 s
mining_basic.py | ✖ Failed | 12 s
mining_getblocktemplate_longpoll.py | ✖ Failed | 8 s
mining_prioritisetransaction.py | ✖ Failed | 1 s
p2p_blockfilters.py | ✖ Failed | 491 s
p2p_compactblocks.py | ✖ Failed | 2 s
p2p_feefilter.py | ✖ Failed | 2 s
p2p_filter.py | ✖ Failed | 1 s
p2p_ibd_txrelay.py | ✖ Failed | 1 s
p2p_invalid_messages.py | ✖ Failed | 4 s
p2p_leak_tx.py | ✖ Failed | 1 s
p2p_permissions.py | ✖ Failed | 8 s
p2p_segwit.py | ✖ Failed | 4 s
rpc_blockchain.py | ✖ Failed | 14 s
rpc_createmultisig.py | ✖ Failed | 1 s
rpc_decodescript.py | ✖ Failed | 1 s
rpc_deriveaddresses.py | ✖ Failed | 1 s
rpc_deriveaddresses.py --usecli | ✖ Failed | 1 s
rpc_dumptxoutset.py | ✖ Failed | 1 s
rpc_generate.py | ✖ Failed | 1 s
rpc_invalid_address_message.py | ✖ Failed | 1 s
rpc_mempool_info.py | ✖ Failed | 1 s
rpc_misc.py | ✖ Failed | 1 s
rpc_net.py | ✖ Failed | 1 s
rpc_packages.py | ✖ Failed | 1 s
rpc_rawtransaction.py --legacy-wallet | ✖ Failed | 1 s
rpc_scanblocks.py | ✖ Failed | 1 s
rpc_scantxoutset.py | ✖ Failed | 1 s
rpc_txoutproof.py | ✖ Failed | 1 s
ALL | ✖ Failed | 1165 s (accumulated) These are the currently failing tests. |
Failing why? Without any information, there is nothing we can do here. Recall that the macOS CI passes on this pull request currently. This looks like a local problem on your side. |
As the exception suggests it's due the addition of the new field
|
@Riahiamirreza To fix that error you'll need to add your new field to the documentation of the affected RPCs. |
To be clear: this cannot just be implemented inside EDIT: oh, actually, when running in non-pruned mode, the UTXO information is available to it through the undo data provided to it. That would allow detecting P2SH. |
@sipa As far as I understand having the information of UTXOs has nothing to do with pruned mode. Don't pruned nodes store the whole UTXO set? (I can guess the problem can occur for pruned mode when a reorg happen and the old data to restore is pruned, but I'm not sure this is the case) |
@Riahiamirreza Actually, ignore what I said about the UTXO set; that's irrelevant. You need access to the spentness information, and that is only available on non-pruned nodes. Thankfully, |
753e007
to
e47b0f6
Compare
e47b0f6
to
65b7634
Compare
@@ -114,6 +114,12 @@ static std::vector<RPCResult> DecodeTxDoc(const std::string& txid_field_doc) | |||
{RPCResult::Type::STR, "asm", "Disassembly of the signature script"}, | |||
{RPCResult::Type::STR_HEX, "hex", "The raw signature script bytes, hex-encoded"}, | |||
}}, | |||
{RPCResult::Type::OBJ, "redeemScript", /*optional=*/true, "", |
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'll add description to description fields later, for now I just wanted to make sure that changing DecodeTxDoc
wasn't wrong.
I'm working on adding tests, but I'm not sure where is the correct place for putting tests. Should I put tests in |
@sipa Would you please review my PR? I really appreciate it. |
🤔 There hasn't been much activity lately and the CI seems to be failing. If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in. |
🐙 This pull request conflicts with the target branch and needs rebase. |
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Closing for now due to inactivity. You can leave a comment below to have this reopened. Also, a new pull request can be opened. |
@maflcko Would you please review the PR if it worth? If you think it does not have enough quality or is out of priority just ignore my comment. |
You'll have to put in some effort to create a pull request that is reviewable. It is fine to have a draft pull request, while you work on it, or ask specific questions about the implementation. However, it is unlikely that someone is going to review an incomplete draft pull request that needs rebase. |
@maflcko You're right, I didn't put much effort on it. Do you think the issue is still relevant? |
This a work in progress PR. I'll squash all my commits at the end to make commits atomic (as mentioned here)
It's an effort to solve this issue #27391.