-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Right now, transactions can be fetched as either full transactions or as pruned
transactions, where they have no signatures and solely the hash of their signatures. For version 2 transactions, this is sufficient to calculate the transaction's hash. For version 1, it is not. Anyone who wishes to verify the version 1 transaction is the requested transaction must make a follow-up request for the full version 1 transaction.
Ideally, I can flag I want verifiable transactions, defined as:
- Full V1 transactions
- Pruned V2 transactions, with the hashes of their prunable sections
This can potentially be done simply. For the following block,
monero/src/rpc/core_rpc_server.cpp
Lines 1137 to 1142 in 8e9ab96
if (req.split || req.prune || pruned) | |
{ | |
// use split form with pruned and prunable (filled only when prune=false and the daemon has it), leaving as_hex as empty | |
e.pruned_as_hex = string_tools::buff_to_hex_nodelimer(std::get<1>(tx)); | |
if (!req.prune) | |
e.prunable_as_hex = string_tools::buff_to_hex_nodelimer(std::get<3>(tx)); |
(!req.prune || (v1_transaction && req.verifiable))
may be sufficient as an alternative condition on the if
check. This would resolve it for /get_transactions
, but ideally the same change is also made for /get_blocks.bin
and any other methods returning potentially-pruned transactions.