What changed, and why it matters
This commit is a cleanup and hardening patch following an earlier pull request. It adds a safety check to make sure outputs are not incorrectly treated as spendable before they should be, fixes several typos and variable-name issues, rewrites a helper function to avoid an unnecessary indirection, and improves comments. There is no direct evidence in the commit that an exploitable vulnerability exists; rather, the changes reduce the chance of future bugs in how Monero tracks spendable outputs for its new FCMP++ membership proofs.
Treat as routine hardening/cleanup. Reviewers should confirm the new CHECK_AND_ASSERT_THROW_MES condition cannot be triggered by legitimate blocks, and that the has_transparent_amounts helper correctly mirrors the previous tx.version >= 2 && !tx.is_coinbase() negation. No urgent security deployment is indicated by this commit alone.
Security signals we found
Added invariant check that outputs unlock no earlier than the default unlock block before adding locked outputs to the database
Refactored transparent-amount commitment collection to remove std::reference_wrapper indirection, reducing complexity
Corrected constant-name typos in spendable-age calculations
Improved comments clarifying pointer safety and migration ordering constraints
Renamed method get_unified_output_by_id to get_unified_outputs_by_id for consistency
Evidence from the diff
The patch is follow-up work to PR #11425 in the Monero blockchain database and transaction-formatting code. Key changes: (1) in BlockchainDB::handle_fcmp_tree, a new CHECK_AND_ASSERT_THROW_MES loop verifies every remaining output’s last_locked_block exceeds the default, preventing outputs that unlock too early from being staged for tree insertion; (2) commitment_is_in_rct_signatures is redefined via a new has_transparent_amounts helper, making the logic clearer and consistent; (3) collect_transparent_amount_commitments is refactored to iterate transactions directly instead of building a vector of std::reference_wrapper; (4) several typos are fixed (CRYPTNOTE→CRYPTONOTE, k_tee→k_tree, method name pluralization, comments). The diff is defensive and does not introduce new externally reachable attack surface.
Changed components
src/blockchain_db/blockchain_db.cppsrc/blockchain_db/blockchain_db.hsrc/blockchain_db/lmdb/db_lmdb.cppsrc/blockchain_db/lmdb/db_lmdb.hsrc/cryptonote_basic/cryptonote_format_utils.cppsrc/cryptonote_basic/cryptonote_format_utils.hsrc/cryptonote_core/tx_verification_utils.cppsrc/fcmp_pp/curve_trees.hInspect captured patch +77 / −59
### src/blockchain_db/blockchain_db.cpp
@@ -340,20 +340,29 @@ void BlockchainDB::handle_fcmp_tree(const uint64_t block_idx,
// locked block higher than the default will be added to the locked outputs
// tables, staged for insertion to the tree later.
new_locked_outs.outs_by_last_locked_block.erase(default_last_locked_block);
+
+ for (const auto& outs_entry : new_locked_outs.outs_by_last_locked_block)
+ {
+ CHECK_AND_ASSERT_THROW_MES(outs_entry.first > default_last_locked_block,
+ "Outputs unlock below the default unlock block.");
+ }
this->add_locked_outs(new_locked_outs.outs_by_last_locked_block, new_locked_outs.timelocked_outputs);
// Assume we just added block n. The soonest that outputs from block n can be
- // included in the chain is in block n + CRYPTNOTE_DEFAULT_SPENDABLE_AGE. So
+ // included in the chain is in block n + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE. So
// we grow the tree with these outputs (and any others with last locked block
- // n + CRYPTNOTE_DEFAULT_SPENDABLE_AGE - 1). We then expect this tree root
+ // n + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE - 1). We then expect this tree root
// be included in block header n+1. This way miners will build on top of the
- // tree root usable in FCMP++'s in a future block. After block
- // n + (CRYPTNOTE_DEFAULT_SPENDABLE_AGE - 1) is added to the chain, SPV
+ // tree root usable in FCMP++s in a future block. After block
+ // n + (CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE - 1) is added to the chain, SPV
// clients syncing just block headers will have a solid assurance that the
// root usable to construct FCMP++ proofs is the correct root, since it will
// have 9 blocks of PoW on top of it.
+ // Note that we don't put the root in block n's header so miners don't have to
+ // manage tree adjustments as the tx pool changes (and then revert/redo changes if
+ // a slightly different block is published by someone else).
// To be clear, block header n+1 includes the tree root usable to spend
- // outputs with last locked block n + CRYPTNOTE_DEFAULT_SPENDABLE_AGE - 1.
+ // outputs with last locked block n + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE - 1.
static_assert(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE > 0, "Expect a non-0 spendable age");
this->advance_tree(block_idx, new_default_locked_outs);
}
@@ -405,10 +414,9 @@ void BlockchainDB::grow_tree(const uint64_t blk_idx, std::vector<fcmp_pp::Unifie
// Get the prev block's tree edge (i.e. the current tree edge before growing)
std::vector<crypto::ec_point> prev_tree_edge;
- uint64_t prev_blk_idx = 0;
if (blk_idx > 0)
{
- prev_blk_idx = blk_idx - 1;
+ const uint64_t prev_blk_idx = blk_idx - 1;
// Make sure tree tip lines up to expected block
const uint64_t tree_block_idx = this->get_tree_block_idx();
@@ -477,7 +485,8 @@ void BlockchainDB::trim_block()
// Remove block from tree meta
this->del_tree_meta(tree_block_idx);
- // If we're removing the genesis block, we need to reverse the initially added in advance_tree.
+ // If we're removing the genesis block, we need to reverse the blocks with no spendable outputs initially added
+ // in advance_tree.
// Since we know they're all empty, we can just delete the tree meta.
if (removing_block_idx == 0)
{
### src/blockchain_db/blockchain_db.h
@@ -549,7 +549,8 @@ class BlockchainDB
virtual std::vector<crypto::ec_point> grow_with_tree_extension(const fcmp_pp::CompressedTreeExtension &tree_extension) = 0;
/**
- * @brief trim the leaves from the tree to the new number of leaf tuples
+ * @brief trim the leaves from the tree to the new number of leaf tuples. The block `trim_block_idx`
+ * must be the latest block appended to the tree.
*
* @param new_n_leaf_tuples the expected number of leaf tuples in the tree after trimming
* @param trim_block_idx the block idx being trimmed
@@ -664,7 +665,7 @@ class BlockchainDB
* @brief handle the FCMP++ curve tree as the provided block_idx enters the chain. This handles
* saving staged locked outputs to the db, and advancing the FCMP++ tree.
*
- * @param block_idx the block being entering the chain
+ * @param block_idx the block entering the chain
* @param first_unified_id the first unified id of the first new default locked output from the block entering the chain
* @param miner_tx the block's miner transaction
* @param txs the block's non-miner transactions
@@ -726,7 +727,8 @@ class BlockchainDB
void advance_tree(const uint64_t block_idx, const std::vector<fcmp_pp::UnifiedOutput> &known_new_outputs);
/**
- * @brief trim a block's worth of data from the tree, placing locked outputs back in the db
+ * @brief trim a block's worth of data from the tree, placing locked outputs back in the db. When popping a block,
+ * this should be called before removing the block's transactions.
*/
void trim_block();
### src/blockchain_db/lmdb/db_lmdb.cpp
@@ -1412,6 +1412,8 @@ void BlockchainLMDB::add_locked_outs(const fcmp_pp::OutsByLastLockedBlock& outs_
throw0(DB_ERROR(("Out " + std::to_string(locked_output.unified_id) + " has unexpected blob size" + std::to_string(output_blob.size())).c_str()));
static_assert(SIZEOF_SERIALIZED_UNIFIED_OUTPUT == 73, "Unified output is stored serialized in 73 bytes");
+ // Assuming blocks are appended in sequence, the outputs at m_cur_locked_outputs[block_id] will be
+ // sorted by unified ids since new blocks only produce higher unified ids.
MDB_val_set(k_block_id, last_locked_block_idx);
MDB_val_sized(v_output, output_blob);
int result = mdb_cursor_put(m_cur_locked_outputs, &k_block_id, &v_output, MDB_APPENDDUP);
@@ -1600,7 +1602,7 @@ uint64_t BlockchainLMDB::get_tree_block_idx() const
return block_idx;
}
-std::vector<crypto::ec_point> BlockchainLMDB::get_tree_edge(uint64_t block_id) const
+std::vector<crypto::ec_point> BlockchainLMDB::get_tree_edge(const uint64_t block_id) const
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
check_open();
@@ -1644,13 +1646,13 @@ void BlockchainLMDB::save_tree_meta(const uint64_t block_idx, const uint64_t n_l
throw0(DB_ERROR("Number of layers in the tree edge does not match expected for the saved n leaf tuples"));
// 1. Save the tree edge
- MDB_val_copy<uint64_t> k_tee(block_idx);
+ MDB_val_copy<uint64_t> k_tree(block_idx);
MDB_val v;
const std::size_t n_layers = tree_edge.size();
v.mv_data = n_layers ? (void *)tree_edge.data() : (void*)"";
v.mv_size = sizeof(crypto::ec_point) * n_layers;
- int result = mdb_cursor_put(m_cur_tree_edges, &k_tee, &v, MDB_NOOVERWRITE);
+ int result = mdb_cursor_put(m_cur_tree_edges, &k_tree, &v, MDB_NOOVERWRITE);
if (result != MDB_SUCCESS)
throw0(DB_ERROR(lmdb_error("Failed to set last hash: ", result).c_str()));
@@ -1707,7 +1709,7 @@ std::vector<crypto::ec_point> BlockchainLMDB::grow_with_tree_extension(const fcm
CURSOR(leaves)
// Insert the leaves
- auto &leaves = tree_extension.leaves;
+ const auto &leaves = tree_extension.leaves;
for (uint64_t i = 0; i < leaves.tuples.size(); ++i)
{
const uint64_t leaf_idx = i + leaves.start_idx;
@@ -1857,7 +1859,7 @@ uint64_t BlockchainLMDB::trim_leaves(const uint64_t new_n_leaf_tuples, const uin
MDEBUG("Successfully removed leaf at leaf_tuple_idx: " << i);
}
- const auto unified_outputs = this->get_unified_output_by_id(unified_ids);
+ const auto unified_outputs = this->get_unified_outputs_by_id(unified_ids);
MDB_val_set(k_block_id, trim_block_idx);
for (const fcmp_pp::UnifiedOutput &unified_output : unified_outputs)
@@ -2026,7 +2028,7 @@ void BlockchainLMDB::trim_layer(const uint64_t new_n_elems_in_layer, const uint6
}
}
-std::vector<fcmp_pp::UnifiedOutput> BlockchainLMDB::get_unified_output_by_id(
+std::vector<fcmp_pp::UnifiedOutput> BlockchainLMDB::get_unified_outputs_by_id(
const std::vector<uint64_t> &unified_ids) const
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
@@ -2037,7 +2039,7 @@ std::vector<fcmp_pp::UnifiedOutput> BlockchainLMDB::get_unified_output_by_id(
std::vector<fcmp_pp::UnifiedOutput> unified_outputs;
unified_outputs.reserve(unified_ids.size());
- // Collect tx hashes from output id's, reading db output_txs
+ // Collect tx hashes from output ids, reading db output_txs
std::vector<tx_out_index> tois;
this->get_output_tx_and_index_from_unified(unified_ids, tois);
@@ -2082,7 +2084,7 @@ std::vector<fcmp_pp::UnifiedOutput> BlockchainLMDB::get_unified_output_by_id(
}
if (unified_ids.size() != unified_outputs.size())
- throw0(DB_ERROR("get_unified_output_by_id: unified_ids <> unified_outputs size mismatch"));
+ throw0(DB_ERROR("get_unified_outputs_by_id: unified_ids <> unified_outputs size mismatch"));
TXN_POSTFIX_RDONLY();
@@ -6069,7 +6071,7 @@ void BlockchainLMDB::migrate_0_1()
throw0(DB_ERROR("Failed to parse block from blob retrieved from the db"));
const auto miner_blob = tx_to_blob(b.miner_tx);
- // Empty transparent amount commitments is ok bc only needed for v2 txs, which v0 db's can't have
+ // Empty transparent amount commitments is ok bc only needed for v2 txs, which v0 dbs can't have
add_transaction(null_hash, b.miner_tx, epee::strspan<std::uint8_t>(miner_blob), {});
for (unsigned int j = 0; j<b.tx_hashes.size(); j++) {
transaction tx;
@@ -6712,7 +6714,7 @@ void BlockchainLMDB::migrate_5_7()
do
{
// 1. Prepare all valid outputs to be inserted into the merkle tree and
- // place them in a locked outputs table. The key to this new table is the
+ // place them in a new locked outputs table. The key to this table is the
// block id in which the outputs unlock.
{
MGINFO("Setting up a locked outputs table (step 1/2 of the full-chain membership proof migration)");
@@ -6736,6 +6738,7 @@ void BlockchainLMDB::migrate_5_7()
MDB_cursor *c_output_amounts, *c_locked_outputs, *c_tmp_last_output, *c_timelocked_outputs;
MDB_val k, v;
+ // `i` is number of read outputs
i = 0;
const uint64_t n_outputs = this->total_outputs();
{
@@ -6769,6 +6772,7 @@ void BlockchainLMDB::migrate_5_7()
}
// Update last output read
+ // - Will be initialized because i != 0
MDB_val_set(v_last_output, last_output);
result = mdb_cursor_put(c_tmp_last_output, (MDB_val*)&zerokval, &v_last_output, 0);
if (result)
@@ -6823,6 +6827,9 @@ void BlockchainLMDB::migrate_5_7()
found_cached_output = true;
// Set k and v so we can continue the migration from that output
+ // POINTER SAFETY: the `found_cached_output` branch below reads k/v and then overwrites v while
+ // `cached_last_o` is still alive. k becomes a dangling pointer below but is overwritten
+ // without being read when MDB_NEXT is used by the next `mdb_cursor_get`.
k = {sizeof(cached_last_o.amount), (void *)&cached_last_o.amount};
const std::size_t outkey_size = (cached_last_o.amount == 0) ? sizeof(outkey) : sizeof(pre_rct_outkey);
@@ -6902,7 +6909,7 @@ void BlockchainLMDB::migrate_5_7()
}};
const fcmp_pp::UnifiedOutput unified_output{
- .unified_id = unified_id,
+ .unified_id = unified_id,
.output_pair = std::move(output_pair)
};
const cryptonote::blobdata output_blob = cryptonote::t_serializable_object_to_blob(unified_output);
@@ -6912,7 +6919,9 @@ void BlockchainLMDB::migrate_5_7()
const bool has_coinbase_unlock_time = output_data.unlock_time == (output_data.height + CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW);
if (has_coinbase_unlock_time)
{
- // Only coinbase outputs could potentially have the coinbase unlock_time (see prevalidate_miner_transaction)
+ // Coinbases only have the coinbase unlock_time (see prevalidate_miner_transaction), but
+ // custom timelocks may also have the coinbase unlock_time so we need to look up the tx to
+ // set `is_coinbase`.
auto toi = this->get_output_tx_and_index_from_unified(unified_id);
auto tx = this->get_pruned_tx(toi.first);
is_coinbase = tx.is_coinbase();
@@ -6929,7 +6938,7 @@ void BlockchainLMDB::migrate_5_7()
MDB_val_set(k_block_id, last_locked_block);
MDB_val_sized(v_output, output_blob);
- // MDB_NODUPDATA because all output id's should be unique
+ // MDB_NODUPDATA because all output ids should be unique
// Can't use MDB_APPENDDUP because outputs aren't inserted in order sorted by unified_id
result = mdb_cursor_put(c_locked_outputs, &k_block_id, &v_output, MDB_NODUPDATA);
if (result != MDB_SUCCESS)
@@ -6942,7 +6951,7 @@ void BlockchainLMDB::migrate_5_7()
MDB_val_set(k_timelocked_block_id, last_locked_block);
MDB_val_sized(v_timelocked_output, output_blob);
- // MDB_NODUPDATA because all output id's should be unique
+ // MDB_NODUPDATA because all output ids should be unique
// Can't use MDB_APPENDDUP because outputs aren't inserted in order sorted by unified_id
result = mdb_cursor_put(c_timelocked_outputs, &k_timelocked_block_id, &v_timelocked_output, MDB_NODUPDATA);
if (result != MDB_SUCCESS)
@@ -6961,6 +6970,7 @@ void BlockchainLMDB::migrate_5_7()
batch_start();
txn.m_txn = m_write_txn->m_txn;
+ // `i` is block index
i = 0;
const uint64_t n_blocks = height();
std::size_t progress_width = 0;
### src/blockchain_db/lmdb/db_lmdb.h
@@ -287,7 +287,7 @@ class BlockchainLMDB final: public BlockchainDB
uint64_t get_tx_block_height(const crypto::hash& h) const override;
- uint64_t total_outputs() const;
+ uint64_t total_outputs() const override;
uint64_t get_num_outputs(const uint64_t& amount) const override;
@@ -470,7 +470,7 @@ class BlockchainLMDB final: public BlockchainDB
void del_tree_meta(const uint64_t block_idx) override;
- std::vector<fcmp_pp::UnifiedOutput> get_unified_output_by_id(const std::vector<uint64_t> &unified_ids) const;
+ std::vector<fcmp_pp::UnifiedOutput> get_unified_outputs_by_id(const std::vector<uint64_t> &unified_ids) const;
// Hard fork
void set_hard_fork_version(uint64_t height, uint8_t version) override;
### src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -1101,12 +1101,17 @@ namespace cryptonote
//---------------------------------------------------------------
bool commitment_is_in_rct_signatures(const transaction_prefix& tx)
{
- return tx.version >= 2 && !tx.is_coinbase();
+ return !has_transparent_amounts(tx);
+ }
+ //---------------------------------------------------------------
+ bool has_transparent_amounts(const transaction_prefix& tx)
+ {
+ return tx.version == 1 || tx.is_coinbase();
}
//---------------------------------------------------------------
bool get_commitment(const transaction& tx, const std::size_t o_idx, const std::unordered_map<uint64_t, rct::key> &transparent_amount_commitments, rct::key &c_out)
{
- static_assert(CURRENT_TRANSACTION_VERSION == 2, "This section of code was written with 2 tx versions in mind. "
+ static_assert(CURRENT_TRANSACTION_VERSION == 2, "This section of code was written with v2 txs in mind. "
"Revisit this section and update for the new tx version.");
CHECK_AND_ASSERT_THROW_MES(tx.version == 1 || tx.version == 2, "encountered unexpected tx version");
@@ -1925,8 +1930,8 @@ namespace cryptonote
}
else if (unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER)
{
- // The unlock_time in this case is supposed to be the chain height at which the output unlocks.
- // The chain height is 1 higher than the highest block index, so we subtract 1 for this delta.
+ // The unlock_time in this case is the first block index where the output is spendable.
+ // Last locked is just prior to that block, so we subtract 1.
last_locked_block_index = unlock_time > 0 ? (unlock_time - 1) : 0;
}
else
@@ -1935,8 +1940,9 @@ namespace cryptonote
implement this here.
1) We use the hf16 block 84785e719b9bcbb763b103bb04b46565cea1c82a4995d984ae30817b8c6ac922 timestamp as an anchor
- point to determine the expected block last locked block index. We use the timestamp that was actually
- recorded in the mainnet chain for this so that it is more accurate.
+ point to determine the expected last locked block index. We use the timestamp that was actually
+ recorded in the mainnet chain for this so that it is more accurate. There is a 'minimum timestamp' of
+ 1656629118 recorded in `mainnet_hard_forks` which we don't need here.
2) As of this writing (chain height 3783990), there are no expected unlock times that are materially affected
by this function's logic. Either some outputs are going to unlock way in the future (because of some
@@ -1951,7 +1957,7 @@ namespace cryptonote
const uint64_t HF_V16_HEIGHT = 2689608;
const uint64_t HF_V16_TIMESTAMP = 1660505834;
- // Use the last hard fork's time and block combo to convert the time-based timelock into an last locked block
+ // Use the last hard fork's time and block combo to convert the time-based timelock into a last locked block
if (HF_V16_TIMESTAMP > unlock_time)
{
const uint64_t seconds_since_unlock = HF_V16_TIMESTAMP - unlock_time;
@@ -1968,11 +1974,11 @@ namespace cryptonote
last_locked_block_index = HF_V16_HEIGHT + blocks_until_unlock;
}
- /* Note: since this function was introduced for the hf that included fcmp's, it's possible for an output to be
+ /* Note: since this function was introduced for the hf that included fcmps, it's possible for an output to be
spent before it reaches the last_locked_block_index going by the old rules; this is ok. It can't be spent again b/c
it'll have a duplicate key image. It's also possible for an output to unlock by old rules, and then re-lock
again at the fork. This is also ok, we just need to be sure that the new hf rules use this last_locked_block_index
- starting at the fork for fcmp's.
+ starting at the fork for fcmps.
*/
MDEBUG("unlock time: " << unlock_time << " , last_locked_block_index: " << last_locked_block_index);
@@ -1984,7 +1990,7 @@ namespace cryptonote
return std::max(last_locked_block_index, default_block_index);
}
//---------------------------------------------------------------
- // Helper function to group outputs by last locked block idx
+ // Groups outputs by last locked block idx
static uint64_t set_tx_outs_by_last_locked_block(const cryptonote::transaction &tx,
const std::unordered_map<uint64_t, rct::key> &transparent_amount_commitments,
const uint64_t &first_unified_id,
### src/cryptonote_basic/cryptonote_format_utils.h
@@ -159,6 +159,7 @@ namespace cryptonote
bool get_output_public_key(const cryptonote::tx_out& out, crypto::public_key& output_public_key);
boost::optional<crypto::view_tag> get_output_view_tag(const cryptonote::tx_out& out);
bool commitment_is_in_rct_signatures(const transaction_prefix& tx);
+ bool has_transparent_amounts(const transaction_prefix& tx);
bool get_commitment(const transaction& tx, const std::size_t o_idx, const std::unordered_map<uint64_t, rct::key> &transparent_amount_commitments, rct::key &c_out);
bool check_inputs_types_supported(const transaction& tx);
bool check_outs_valid(const transaction& tx);
### src/cryptonote_core/tx_verification_utils.cpp
@@ -35,8 +35,6 @@
#include "hardforks/hardforks.h"
#include "ringct/rctSigs.h"
-#include <functional>
-
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "verify"
@@ -313,25 +311,20 @@ static bool ver_non_input_consensus_templated(TxForwardIt tx_begin, TxForwardIt
return true;
}
-static void collect_transparent_amount_commitments_static(
- const std::vector<std::reference_wrapper<const transaction>> &txs,
+static void collect_transparent_amount_commitments_from_tx(
+ const transaction &tx,
std::unordered_map<uint64_t, rct::key> &transparent_amount_commitments_inout)
{
// Note: we do not clear transparent_amount_commitments_inout because it may be a rolling cache
- for (const auto &tx_ref : txs)
+ // We only need commitments for transparent amounts, which are tx version 1 || coinbase txs
+ if (!has_transparent_amounts(tx))
+ return;
+ for (const auto &tx_out : tx.vout)
{
- const auto &tx = tx_ref.get();
-
- // We only need commitments for transparent amounts, which are tx version 1 || coinbase txs
- if (tx.version > 1 && !tx.is_coinbase())
- continue;
- for (const auto &tx_out : tx.vout)
- {
- const uint64_t amount = tx_out.amount;
- if (transparent_amount_commitments_inout.find(amount) == transparent_amount_commitments_inout.end())
- transparent_amount_commitments_inout[amount] = rct::zeroCommitVartime(amount);
- }
+ const uint64_t amount = tx_out.amount;
+ if (transparent_amount_commitments_inout.find(amount) == transparent_amount_commitments_inout.end())
+ transparent_amount_commitments_inout[amount] = rct::zeroCommitVartime(amount);
}
}
@@ -345,12 +338,9 @@ void collect_transparent_amount_commitments(
const std::vector<std::pair<transaction, blobdata>> &tx_pairs,
std::unordered_map<uint64_t, rct::key> &transparent_amount_commitments_inout)
{
- std::vector<std::reference_wrapper<const transaction>> tx_refs;
- tx_refs.reserve(1 + tx_pairs.size());
- tx_refs.push_back(std::cref(miner_tx));
+ collect_transparent_amount_commitments_from_tx(miner_tx, transparent_amount_commitments_inout);
for (const auto &tx : tx_pairs)
- tx_refs.push_back(std::cref(tx.first));
- collect_transparent_amount_commitments_static(tx_refs, transparent_amount_commitments_inout);
+ collect_transparent_amount_commitments_from_tx(tx.first, transparent_amount_commitments_inout);
}
uint64_t get_transaction_weight_limit(const uint8_t hf_version)
### src/fcmp_pp/curve_trees.h
@@ -173,7 +173,7 @@ class CurveTrees
std::size_t n_layers(const uint64_t n_leaf_tuples) const;
// Decompress the compressed points from the provided tree edge
- LastHashes tree_edge_to_last_hashes(const std::vector<crypto::ec_point> &tree_edge_to_last_hashes) const;
+ LastHashes tree_edge_to_last_hashes(const std::vector<crypto::ec_point> &tree_edge) const;
// Compress all the points in the tree extension
CompressedTreeExtension compress_tree_extension(TreeExtension &&tree_extension) const;Why this scored 25/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.