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

Update fee calculation and thresholds so that large z_sendmany transactions are mined #1851

Closed
bitcartel opened this issue Nov 12, 2016 · 1 comment

Comments

@bitcartel
Copy link
Contributor

bitcartel commented Nov 12, 2016

Background: This ticket is based on real-world usage where a user failed to send funds to 1,500 taddr recipients.

A single joinsplit transaction from zaddr -> 1384 taddr recipients will be propagated between nodes, and eventually mined as a low-fee transaction, given that the fixed z_sendmany fee of 10,000 still applies.

However, a transaction from zaddr-> 1385 taddr recipients will not be mined as mempools will reject the transaction for having a fee which is too low.

Firstly, the transaction has a size of 49001 bytes, one byte more than the threshold of DEFAULT_BLOCK_PRIORITY_SIZE - 1000 (where DEFAULT_BLOCK_PRIORITY_SIZE is 50000). Breaking this size threshold means that a minimum fee of 0 is no longer applicable for this transaction.

Second, the minimum fee which is now applicable is calculated from the formula nSatoshisPerK*nSize / 1000 where the default value for nSatoshisPerK comes from minRelayTxFee which is 5000. Thus, with nSize = 49001, the minimum fee is 245,005 i.e. > 24x the actual fee of 10,000.

When resolving this issue, we must bear in mind that multiple notes may be consumed across multiple joinsplits in order to add value back to the transparent pool.

Related: #1719 (dust and fees)
Related: #1808 (based on max tx size, limit on taddr recipients is ~2900)

@nathan-at-least
Copy link
Contributor

Immediate step: notify users a work-around is to split large z_sendmany calls (with >= 1385 t-addr recipients) into multiple calls, each with <= 1384 recipients.

Those numbers will be different with more or fewer JoinSplits.

Longer term: what would it take to update the existing wallet fee estimation for 0 JS transactions to properly account for >0 JS transactions, so that there's no special case for >0 JS?

bitcartel added a commit to bitcartel/zcash that referenced this issue Nov 15, 2016
Issue zcash#1851 shows that a zaddr->taddr can be rejected from mempools
due to not meeting fee requirements given the size of the transaction.
Fee calculation for joinsplit txs has not yet been agreed upon, so
during this interim period, this patch ensures  joinsplit txs using
the default fee are not rejected due to an insufficient fee.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@bitcartel @nathan-at-least and others