placeholder checkin because of so many changes having been made - let's use github as a backup site

This commit is contained in:
Some Random Crypto Guy
2023-11-09 18:53:09 +00:00
parent aefeb0f83a
commit 7f6b8daa49
23 changed files with 484 additions and 170 deletions
+49 -14
View File
@@ -1666,12 +1666,49 @@ bool Blockchain::create_block_template(block& b, const crypto::hash *from_block,
CHECK_AND_ASSERT_MES(diffic, false, "difficulty overhead.");
std::map<std::string, uint64_t> circ_supply = get_db().get_circulating_supply();
size_t txs_weight;
uint64_t fee;
if (!m_tx_pool.fill_block_template(b, median_weight, already_generated_coins, txs_weight, fee, expected_reward, b.major_version))
/**
* Here is where the magic happens - determination of the payments for the protocol_tx
*
* We need to know the following:
* - address to send the funds to ("destination_address")
* - asset_type being burnt
* - amount being burnt
* - asset_type being minted
*
* (All of this information should be provided by the txpool_tx_meta_t object)
*
* From that little lot, we can hopefully work out the slippage on all of the TXs, and
* therefore the amount to be minted for each TX, and who to pay it to, etc, etc.
*/
std::vector<txpool_tx_meta_t> protocol_metadata;
std::vector<cryptonote::protocol_data_entry> protocol_entries;
if (!m_tx_pool.fill_block_template(b, median_weight, already_generated_coins, txs_weight, fee, expected_reward, b.major_version, pr, circ_supply, protocol_metadata))
{
return false;
}
// Clone the txpool_tx_meta_t data into a more useable format
for (auto& meta: protocol_metadata) {
cryptonote::protocol_data_entry entry;
entry.amount_burnt = meta.amount_burnt;
entry.amount_minted = 0;
entry.amount_slippage_limit = meta.amount_slippage_limit;
entry.source_asset = asset_type_from_id(meta.source_asset_id);
entry.destination_asset = asset_type_from_id(meta.destination_asset_id);
entry.destination_address = meta.destination_address;
protocol_entries.push_back(entry);
}
// Time to construct the protocol_tx
uint64_t protocol_fee = 0;
bool ok = construct_protocol_tx(height, protocol_fee, b.protocol_tx, protocol_entries, circ_supply, pr, b.major_version);
CHECK_AND_ASSERT_MES(ok, false, "Failed to construct protocol tx");
pool_cookie = m_tx_pool.cookie();
#if defined(DEBUG_CREATE_BLOCK_TEMPLATE)
size_t real_txs_weight = 0;
@@ -2444,7 +2481,7 @@ bool Blockchain::find_blockchain_supplement(const std::list<crypto::hash>& qbloc
bool Blockchain::get_pricing_record(oracle::pricing_record& pr, uint64_t timestamp)
{
LOG_PRINT_L1("Requesting pricing record from Oracle - time : " << timestamp);
/*
bool r = false;
const uint8_t hf_version = m_hardfork->get_current_version();
@@ -2472,18 +2509,6 @@ bool Blockchain::get_pricing_record(oracle::pricing_record& pr, uint64_t timesta
// Copy the PR
pr = res.pr;
/*
pr.version = res.pr.version;
pr.timestamp = res.pr.timestamp;
for (auto &asset: res.pr.assets) {
cryptonote::pricing_record_entry entry;
entry.asset_type = asset.asset;
entry.spot = asset.spot;
entry.ma = asset.ma;
pr.assets.push_back(entry);
}
pr.signature = res.pr.signature;
*/
// Verify the signature
if (pr.verifySignature(get_config(m_nettype).ORACLE_PUBLIC_KEY)) {
} else {
@@ -2498,6 +2523,11 @@ bool Blockchain::get_pricing_record(oracle::pricing_record& pr, uint64_t timesta
sig_hex += ss.str();
}
LOG_PRINT_L1("Received pricing record - signature = " << sig_hex);
*/
uint64_t height = get_current_blockchain_height();
std::vector<uint64_t> prices = {200000000, 150000000, 100000000, 75000000};
pr.spot = pr.moving_average = prices[height % 4];
return true;
}
@@ -3358,6 +3388,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
const uint8_t hf_version = m_hardfork->get_current_version();
/*
if (tx.version >= 2)
{
if (tx.vout.size() < 2)
@@ -3367,6 +3398,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
return false;
}
}
*/
// from hard fork 2, we require mixin at least 2 unless one output cannot mix with 2 others
// if one output cannot mix with 2 others, we accept at most 1 output that can mix
@@ -3493,6 +3525,9 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
CHECK_AND_ASSERT_MES(txin.type() == typeid(txin_to_key), false, "wrong type id in tx input at Blockchain::check_tx_inputs");
const txin_to_key& in_to_key = boost::get<txin_to_key>(txin);
// Make sure the user isn't trying to spend BURNt coins
CHECK_AND_ASSERT_MES(in_to_key.asset_type not_eq "BURN", false, "trying to spend BURNt coins");
// make sure tx output has key offset(s) (is signed to be used)
CHECK_AND_ASSERT_MES(in_to_key.key_offsets.size(), false, "empty in_to_key.key_offsets in transaction with id " << get_transaction_hash(tx));
+3 -4
View File
@@ -925,7 +925,7 @@ namespace cryptonote
tx_info[n].result = false;
break;
case rct::RCTTypeSimple:
if (!rct::verRctSemanticsSimple(rv))
if (!rct::verRctSemanticsSimple(rv, tx_info[n].tx->amount_burnt))
{
MERROR_VER("rct signature semantics check failed");
set_semantics_failed(tx_info[n].tx_hash);
@@ -976,18 +976,17 @@ namespace cryptonote
break;
}
}
if (!rvv.empty() && !rct::verRctSemanticsSimple(rvv))
if (!rvv.empty())
{
LOG_PRINT_L1("One transaction among this group has bad semantics, verifying one at a time");
ret = false;
const bool assumed_bad = rvv.size() == 1; // if there's only one tx, it must be the bad one
for (size_t n = 0; n < tx_info.size(); ++n)
{
if (!tx_info[n].result)
continue;
if (tx_info[n].tx->rct_signatures.type != rct::RCTTypeBulletproof && tx_info[n].tx->rct_signatures.type != rct::RCTTypeBulletproof2 && tx_info[n].tx->rct_signatures.type != rct::RCTTypeCLSAG && tx_info[n].tx->rct_signatures.type != rct::RCTTypeBulletproofPlus)
continue;
if (assumed_bad || !rct::verRctSemanticsSimple(tx_info[n].tx->rct_signatures))
if (!rct::verRctSemanticsSimple(tx_info[n].tx->rct_signatures, tx_info[n].tx->amount_burnt))
{
set_semantics_failed(tx_info[n].tx_hash);
tx_info[n].tvc.m_verifivation_failed = true;
+193 -18
View File
@@ -76,6 +76,165 @@ namespace cryptonote
LOG_PRINT_L2("destinations include " << num_stdaddresses << " standard addresses and " << num_subaddresses << " subaddresses");
}
//---------------------------------------------------------------
bool get_conversion_rate(const oracle::pricing_record& pr, const std::string& from_asset, const std::string& to_asset, uint64_t& rate) {
// Check for burns
if (to_asset == "") {
LOG_ERROR("Converting to a BURN is nonsensical - aborting");
rate = std::numeric_limits<uint64_t>::max();
return false;
}
// Check for transfers
if (from_asset == to_asset) {
rate = COIN;
return true;
}
if (from_asset == "FULM") {
// FULM as source
if (to_asset not_eq "FUSD") {
// Invalid conversion - abort
LOG_ERROR("Invalid conversion (" << from_asset << "," << to_asset << ") - aborting");
return false;
}
// Scale to FUSD
rate = pr["FUSD"];
} else if (from_asset == "FUSD") {
// FUSD as source
if (to_asset not_eq "FULM") {
// Invalid conversion - abort
LOG_ERROR("Invalid conversion (" << from_asset << "," << to_asset << ") - aborting");
return false;
}
// Scale to FULM
boost::multiprecision::uint128_t rate_128 = COIN;
rate_128 *= COIN;
rate_128 /= pr["FUSD"];
rate = rate_128.convert_to<uint64_t>();
rate -= (rate % 10000);
}
return true;
}
//---------------------------------------------------------------
bool get_converted_amount(const uint64_t& conversion_rate, const uint64_t& source_amount, uint64_t& dest_amount) {
if (!conversion_rate || !source_amount) {
LOG_ERROR("Invalid conversion rate or input amount for conversion (" << conversion_rate << "," << source_amount << ") - aborting");
return false;
}
boost::multiprecision::uint128_t source_amount_128 = source_amount;
boost::multiprecision::uint128_t conversion_rate_128 = conversion_rate;
boost::multiprecision::uint128_t dest_amount_128 = source_amount_128 * conversion_rate_128;
dest_amount_128 /= COIN;
dest_amount = dest_amount_128.convert_to<uint64_t>();
return true;
}
//---------------------------------------------------------------
bool calculate_conversion(const std::string& source_asset, const std::string& dest_asset, const uint64_t amount_burnt, const uint64_t amount_slippage_limit, uint64_t& amount_minted, uint64_t& amount_slippage, const std::map<std::string, uint64_t> circ_supply, const oracle::pricing_record& pr, const uint8_t hf_version) {
// Sanity check - are the asset types a valid conversion?
CHECK_AND_ASSERT_MES(source_asset != dest_asset, false, "cannot calculate slippage when source and dest assets are identical");
CHECK_AND_ASSERT_MES(source_asset != "", false, "source_asset not provided");
CHECK_AND_ASSERT_MES(dest_asset != "", false, "dest_asset not provided (is this a BURN?)");
/////CHECK_AND_ASSERT_MES(pr.has_rate(dest_asset), false, "missing rate for " << dest_asset <<" in pricing record - cannot calculate conversion");
CHECK_AND_ASSERT_MES(circ_supply.count(source_asset) != 0, false, "missing circulating_supply data - cannot calculate slippage");
// Get the conversion rate for the TX
uint64_t conversion_rate = COIN;
bool ok = get_conversion_rate(pr, source_asset, dest_asset, conversion_rate);
CHECK_AND_ASSERT_MES(ok, false, "Unable to get conversion rate for " << source_asset << " to " << dest_asset);
if (hf_version >= HF_VERSION_SLIPPAGE_YIELD) {
// Apply slippage to the burnt amount
amount_slippage = 0;
// Check that the slippage is acceptable
if (amount_slippage > amount_slippage_limit) {
// Bail out with no conversion
LOG_PRINT_L1("Unable to convert - slippage limit was too low");
amount_minted = 0;
return true;
}
}
// Work out the converted amount
ok = get_converted_amount(conversion_rate, amount_burnt - amount_slippage, amount_minted);
CHECK_AND_ASSERT_MES(ok, false, "Unable to get converted amount for " << (amount_burnt - amount_slippage) << ", converting from " << source_asset << " to " << dest_asset);
return true;
}
//---------------------------------------------------------------
bool construct_protocol_tx(const size_t height,
uint64_t& protocol_fee,
transaction& tx,
std::vector<protocol_data_entry>& protocol_data,
std::map<std::string, uint64_t> circ_supply,
const oracle::pricing_record& pr,
const uint8_t hf_version) {
// Clear the TX contents
tx.set_null();
keypair txkey = keypair::generate(hw::get_device("default"));
add_tx_pub_key_to_extra(tx, txkey.pub);
if (!sort_tx_extra(tx.extra, tx.extra))
return false;
txin_gen in;
in.height = height;
// Update the circulating_supply information, while keeping a count of amount to be created using txin_gen
std::map<std::string, uint64_t> txin_gen_totals;
uint64_t txin_gen_final = 0;
for (auto const& entry: protocol_data) {
if (!circ_supply.count(entry.source_asset)) {
LOG_ERROR("Circulating supply does not have " << entry.source_asset << " balance - invalid source_asset");
return false;
}
// Deduct the amount_burnt from the circulating_supply balance
circ_supply[entry.source_asset] -= entry.amount_burnt;
}
// Calculate the slippage for the output amounts
for (auto const& entry: protocol_data) {
if (entry.destination_asset == "") {
// BURN TX - no slippage, no money minted - skip
continue;
}
// CONVERT TX - calculate the slippage, and decide if it is going to be converted or refunded
uint64_t amount_slippage = 0, amount_minted = 0;
bool ok = cryptonote::calculate_conversion(entry.source_asset, entry.destination_asset, entry.amount_burnt, entry.amount_slippage_limit, amount_minted, amount_slippage, circ_supply, pr, hf_version);
if (!ok) {
LOG_ERROR("failed to calculate slippage when trying to build protocol_tx");
return false;
}
if (amount_minted == 0) {
// REFUND
txin_gen_totals[entry.source_asset] += entry.amount_burnt;
// Create the TX output for this refund
tx_out out;
cryptonote::set_tx_out(entry.amount_burnt, entry.source_asset, 0, entry.destination_address, false, crypto::view_tag{}, out);
tx.vout.push_back(out);
} else {
// CONVERTED
txin_gen_totals[entry.destination_asset] += amount_minted;
// Create the TX output for this conversion
tx_out out;
cryptonote::set_tx_out(amount_minted, entry.destination_asset, 0, entry.destination_address, false, crypto::view_tag{}, out);
tx.vout.push_back(out);
}
}
// TODO: create the YIELD outputs
// TODO: sum the txin_gen_totals values so that we know how much we are going to include in the protocol TX
return false;
}
//---------------------------------------------------------------
bool construct_miner_tx(size_t height, size_t median_weight, uint64_t already_generated_coins, size_t current_block_weight, uint64_t fee, const account_public_address &miner_address, transaction& tx, const blobdata& extra_nonce, size_t max_outs, uint8_t hard_fork_version) {
// Clear the TX contents
@@ -111,9 +270,9 @@ namespace cryptonote
// from hard fork 4, we use a single "dusty" output. This makes the tx even smaller,
// and avoids the quantization. These outputs will be added as rct outputs with identity
// masks, to they can be used as rct inputs.
if (hard_fork_version >= 2 && hard_fork_version < 4) {
block_reward = block_reward - block_reward % ::config::BASE_REWARD_CLAMP_THRESHOLD;
}
//if (hard_fork_version >= 2 && hard_fork_version < 4) {
// block_reward = block_reward - block_reward % ::config::BASE_REWARD_CLAMP_THRESHOLD;
//}
std::vector<uint64_t> out_amounts;
decompose_amount_into_digits(block_reward, hard_fork_version >= 2 ? 0 : ::config::DEFAULT_DUST_THRESHOLD,
@@ -271,6 +430,24 @@ namespace cryptonote
tx.extra = extra;
crypto::public_key txkey_pub;
transaction_type tx_type;
if (!get_tx_type(source_asset, dest_asset, tx_type)) {
LOG_ERROR("invalid tx type");
return false;
}
tx.type = static_cast<uint8_t>(tx_type);
// Is this a CONVERT tx?
if (tx_type == cryptonote::transaction_type::CONVERT) {
// Set the destination address to be something only our wallet can identify
// This is where Fulmo gets interesting...
tx.destination_address = get_destination_view_key_pub(destinations, change_addr);
}
// Set the source and destination asset_type values
tx.source_asset_type = source_asset;
tx.destination_asset_type = dest_asset;
// if we have a stealth payment id, find it and encrypt it with the tx key now
std::vector<tx_extra_field> tx_extra_fields;
if (parse_tx_extra(tx.extra, tx_extra_fields))
@@ -402,12 +579,6 @@ namespace cryptonote
tx.vin.push_back(input_to_key);
}
transaction_type tx_type;
if (!get_tx_type(source_asset, dest_asset, tx_type)) {
LOG_ERROR("invalid tx type");
return false;
}
if (shuffle_outs)
{
std::shuffle(destinations.begin(), destinations.end(), crypto::random_device{});
@@ -470,19 +641,23 @@ namespace cryptonote
additional_tx_public_keys, amount_keys, out_eph_public_key,
use_view_tags, view_tag);
// Is this a BURN or CONVERT TX?
if (tx_type == cryptonote::transaction_type::BURN || tx_type == cryptonote::transaction_type::CONVERT) {
// Do not create outputs that are for the destination asset type - discard them as unused
if (dst_entr.asset_type == dest_asset) {
tx.amount_burnt += dst_entr.amount;
amount_keys.pop_back();
if (tx_type == cryptonote::transaction_type::CONVERT) {
//tx.amount_slippage_limit += dst_entr.amount;
}
continue;
}
}
tx_out out;
cryptonote::set_tx_out(dst_entr.amount, dst_entr.asset_type, unlock_time, out_eph_public_key, use_view_tags, view_tag, out);
tx.vout.push_back(out);
output_index++;
summary_outs_money += dst_entr.amount;
if (tx_type == cryptonote::transaction_type::BURN || tx_type == cryptonote::transaction_type::CONVERT) {
if (dst_entr.asset_type == dest_asset) {
tx.amount_burnt += dst_entr.amount;
}
if (tx_type == cryptonote::transaction_type::CONVERT) {
tx.amount_minted += dst_entr.amount;
}
}
}
CHECK_AND_ASSERT_MES(additional_tx_public_keys.size() == additional_tx_keys.size(), false, "Internal error creating additional public keys");
@@ -654,7 +829,7 @@ namespace cryptonote
if (!use_simple_rct && amount_in > amount_out)
outamounts.push_back(amount_in - amount_out);
else
fee = summary_inputs_money - summary_outs_money;
fee = summary_inputs_money - summary_outs_money - tx.amount_burnt;
// zero out all amounts to mask rct outputs, real amounts are now encrypted
for (size_t i = 0; i < tx.vin.size(); ++i)
+25 -1
View File
@@ -38,8 +38,33 @@
namespace cryptonote
{
bool get_conversion_rate(const oracle::pricing_record& pr, const std::string& from_asset, const std::string& to_asset, uint64_t& rate);
bool get_converted_amount(const uint64_t& conversion_rate, const uint64_t& source_amount, uint64_t& dest_amount);
bool calculate_conversion(const std::string& source_asset, const std::string& dest_asset, const uint64_t amount_burnt, const uint64_t amount_slippage_limit, uint64_t& amount_minted, uint64_t& amount_slippage, const std::map<std::string, uint64_t> circ_supply, const oracle::pricing_record& pr, const uint8_t hf_version);
//---------------------------------------------------------------
/**
* Construct the protocol_tx
*
* @param height the current blockchain height (for reasons unknown)
* @param protocol_fee a variable that will receive the total supplementary fee due to be assigned to the block reward
* @param tx the actual TX instance to be populated with the necessary txin_gen and txout_to_key entries etc
* @param hf_version the current hard-fork version of the blockchain
*
* @return TRUE on success, FALSE otherwise (duh)
*/
struct protocol_data_entry
{
crypto::public_key destination_address;
uint64_t amount_burnt;
uint64_t amount_minted;
uint64_t amount_slippage_limit;
std::string source_asset;
std::string destination_asset;
};
bool construct_protocol_tx(const size_t height, uint64_t& protocol_fee, transaction& tx, std::vector<protocol_data_entry>& protocol_data, std::map<std::string, uint64_t> circ_supply, const oracle::pricing_record& pr, const uint8_t hf_version);
//---------------------------------------------------------------
bool construct_miner_tx(size_t height, size_t median_weight, uint64_t already_generated_coins, size_t current_block_weight, uint64_t fee, const account_public_address &miner_address, transaction& tx, const blobdata& extra_nonce = blobdata(), size_t max_outs = 999, uint8_t hard_fork_version = 1);
bool construct_protocol_tx(size_t height, transaction& tx, size_t max_outs = 999, uint8_t hard_fork_version = 1);
struct tx_source_entry
{
@@ -156,7 +181,6 @@ namespace cryptonote
crypto::hash get_block_longhash(const Blockchain *pb, const block& b, const uint64_t height, const crypto::hash *seed_hash = nullptr, const int miners = 0);
void get_altblock_longhash(const block& b, crypto::hash& res, const crypto::hash& seed_hash);
bool get_tx_asset_types(const transaction& tx, const crypto::hash &txid, std::string& source, std::string& destination, const bool is_miner_tx);
bool get_tx_type(const std::string& source, const std::string& destination, transaction_type& type);
}
+32 -8
View File
@@ -282,6 +282,14 @@ namespace cryptonote
meta.pruned = tx.pruned;
meta.bf_padding = 0;
memset(meta.padding, 0, sizeof(meta.padding));
//SRCG - need to work out how to populate this
meta.destination_address = tx.destination_address;
meta.amount_burnt = tx.amount_burnt;
meta.amount_slippage_limit = tx.amount_slippage_limit;
meta.source_asset_id = cryptonote::asset_id_from_type(tx.source_asset_type);
meta.destination_asset_id = cryptonote::asset_id_from_type(tx.destination_asset_type);
try
{
if (kept_by_block)
@@ -358,6 +366,13 @@ namespace cryptonote
meta.bf_padding = 0;
memset(meta.padding, 0, sizeof(meta.padding));
//SRCG - need to work out how to populate this
meta.destination_address = tx.destination_address;
meta.amount_burnt = tx.amount_burnt;
meta.amount_slippage_limit = tx.amount_slippage_limit;
meta.source_asset_id = cryptonote::asset_id_from_type(tx.source_asset_type);
meta.destination_asset_id = cryptonote::asset_id_from_type(tx.destination_asset_type);
if (!insert_key_images(tx, id, tx_relay))
return false;
@@ -1492,7 +1507,7 @@ namespace cryptonote
}
//---------------------------------------------------------------------------------
//TODO: investigate whether boolean return is appropriate
bool tx_memory_pool::fill_block_template(block &bl, size_t median_weight, uint64_t already_generated_coins, size_t &total_weight, uint64_t &fee, uint64_t &expected_reward, uint8_t version)
bool tx_memory_pool::fill_block_template(block &bl, size_t median_weight, uint64_t already_generated_coins, size_t &total_weight, uint64_t &fee, uint64_t &expected_reward, uint8_t version, oracle::pricing_record& pr, std::map<std::string, uint64_t>& circ_supply, std::vector<txpool_tx_meta_t>& protocol_metadata)
{
CRITICAL_REGION_LOCAL(m_transactions_lock);
CRITICAL_REGION_LOCAL1(m_blockchain);
@@ -1530,6 +1545,7 @@ namespace cryptonote
warned = true;
continue;
}
LOG_PRINT_L2("Considering " << sorted_it->second << ", weight " << meta.weight << ", current block weight " << total_weight << "/" << max_total_weight << ", current coinbase " << print_money(best_coinbase) << ", relay method " << (unsigned)meta.get_relay_method());
if (!meta.matches(relay_category::legacy) && !(m_mine_stem_txes && meta.get_relay_method() == relay_method::stem))
@@ -1601,14 +1617,14 @@ namespace cryptonote
if (memcmp(&original_meta, &meta, sizeof(meta)))
{
try
{
m_blockchain.update_txpool_tx(sorted_it->second, meta);
}
{
m_blockchain.update_txpool_tx(sorted_it->second, meta);
}
catch (const std::exception &e)
{
MERROR("Failed to update tx meta: " << e.what());
// continue, not fatal
}
{
MERROR("Failed to update tx meta: " << e.what());
// continue, not fatal
}
}
if (!ready)
{
@@ -1621,6 +1637,14 @@ namespace cryptonote
continue;
}
// Check what the TX type is - only CONVERT needs a cash_value
if (meta.source_asset_id == meta.destination_asset_id) {
// TRANSFER
} else {
// BURN OR CONVERT (both require inclusion in the protocol_tx calculation for circ_supply purposes)
protocol_metadata.push_back(meta);
}
bl.tx_hashes.push_back(sorted_it->second);
total_weight += meta.weight;
fee += meta.fee;
+6 -1
View File
@@ -52,6 +52,8 @@
#include "rpc/core_rpc_server_commands_defs.h"
#include "rpc/message_data_structs.h"
#include "oracle/pricing_record.h"
namespace cryptonote
{
class Blockchain;
@@ -233,10 +235,13 @@ namespace cryptonote
* @param fee return-by-reference the total of fees from the included transactions
* @param expected_reward return-by-reference the total reward awarded to the miner finding this block, including transaction fees
* @param version hard fork version to use for consensus rules
* @param pr the current pricing record
* @param circ_cupply the circulating supply information for all asset types
* @param protocol_metadata the TX-specific data needed to create conversion outputs in the protocol TX (including converted amounts and refunds)
*
* @return true
*/
bool fill_block_template(block &bl, size_t median_weight, uint64_t already_generated_coins, size_t &total_weight, uint64_t &fee, uint64_t &expected_reward, uint8_t version);
bool fill_block_template(block &bl, size_t median_weight, uint64_t already_generated_coins, size_t &total_weight, uint64_t &fee, uint64_t &expected_reward, uint8_t version, oracle::pricing_record& pr, std::map<std::string, uint64_t>& circ_supply, std::vector<txpool_tx_meta_t>& protocol_metadata);
/**
* @brief get a list of all transactions in the pool