Skip to content
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

tx fee issue #147

Closed
saltedlolly opened this issue Dec 21, 2023 · 2 comments
Closed

tx fee issue #147

saltedlolly opened this issue Dec 21, 2023 · 2 comments

Comments

@saltedlolly
Copy link

As documented by James from CoinMinerz on 26th October on the DigiByte Discord:

"Another thing we need to address is tx fee bug to make sure anyone using RC2 or RC3 on mainnet doesn't have the mempool issue we've seen on coinminerz when payments go out. What happens is the tx fee is too low in the code and when sent it sits in mempool as it's a cheaper tx fee."

https://discord.com/channels/878200503815782400/1117868419283423293/1166363365061431417

@JaredTate
Copy link

Thanks for bringing this issue up. We increased DEFAULT_MIN_RELAY_TX_FEE but it appears we likely need to also increase DEFAULT_BLOCK_MIN_TX_FEE & maybe DEFAULT_INCREMENTAL_RELAY_FEE & DUST_RELAY_TX_FEE.

static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 100000;

static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;

It looks like DEFAULT_BLOCK_MIN_TX_FEE is called in BlockAssembler, so its being assembled with lower fees, then getting rejected by PeerManagerImpl::MaybeSendFeefilter where DEFAULT_MIN_RELAY_TX_FEE is called.

digibyte/src/miner.cpp

Lines 56 to 59 in b75fea6

BlockAssembler::Options::Options() {
blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE);
nBlockMaxWeight = DEFAULT_BLOCK_MAX_WEIGHT;
}

PeerManagerImpl::MaybeSendFeefilter calls DEFAULT_MIN_RELAY_TX_FEE and filters out TXs without high enough fees, that's why they sit in mempool. Block assembler not including high enough fee.

void PeerManagerImpl::MaybeSendFeefilter(CNode& pto, std::chrono::microseconds current_time)
{
AssertLockHeld(cs_main);
if (m_ignore_incoming_txs) return;
if (!pto.m_tx_relay) return;
if (pto.GetCommonVersion() < FEEFILTER_VERSION) return;
// peers with the forcerelay permission should not filter txs to us
if (pto.HasPermission(NetPermissionFlags::ForceRelay)) return;
CAmount currentFilter = m_mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK();
static FeeFilterRounder g_filter_rounder{CFeeRate{DEFAULT_MIN_RELAY_TX_FEE}};

We should probably update these below too:

static const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE = 1000;

static const unsigned int DUST_RELAY_TX_FEE = 3000;

@ycagel
Copy link
Member

ycagel commented Feb 1, 2024

This issue is resolved as #151 and #157 have been merged.

@ycagel ycagel closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants