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

Remove TX priority and free transaction area from mempool, block creator. #6405

Closed
wants to merge 3 commits into from

Conversation

jgarzik
Copy link
Contributor

@jgarzik jgarzik commented Jul 9, 2015

It was noted on #bitcoin-dev that many simplifications arise from removing the complex, dual-policy aspects of priority-based low fee transactions on policy estimation, block template creation and mempool code. This change updates Bitcoin Core to relay purely based on fee/kb rate, removing the concepts of priority and free transactions from the codebase.

fSendFreeTransactions, fLimitFree and similar controls have been operating in the field defaulting to fee-based choices already.

This change should make other changes such as @pstratem 's work to cap the mempool size dynamically much easier.

Notes:

  • Status: Watching travis. A large change, largely untested, so not ready for merging without lots of feedback and testing.
  • Thus, requesting feedback and testing...
  • Transaction fee deltas are preserved - thus TX "priority" remains to some extent
  • prioritisetransaction RPC call continues to work, by adjusting the fee.
  • needs focused review in the area of wallet, to ensure IsMine() transactions work fine through reorgs

@luke-jr
Copy link
Member

luke-jr commented Jul 9, 2015

NACK. This makes a number of policies harder to implement for the sake of a "simpler" (and less competent) default policy. I'm working on a mempool size cap that doesn't break policy freedom so completely.

@jgarzik
Copy link
Contributor Author

jgarzik commented Jul 9, 2015

Can you be more specific about which policies become harder to implement?

@luke-jr
Copy link
Member

luke-jr commented Jul 9, 2015

Priority-sorted area followed by fee/kB-sorted area (the previous default policy) would be the most obvious one. The policy before that (gradually higher min fee/kB as blocks are filled) as well.

@jgarzik
Copy link
Contributor Author

jgarzik commented Jul 9, 2015

@luke-jr Read the code. You can implement such a policy with fee deltas.

@petertodd
Copy link
Contributor

Concept ACK, will review code and test later.

I've looked into policy stuff myself, and fee-delta methods make the most sense to me.

@domob1812
Copy link
Contributor

I actually like the concept of priority, which means that coinage can be used to "pay" for fees as a spam prevention. The "production rate" of coinage is bounded, which means that one can set a minimum priority for transactions and a certain reserved size in each block and be ensured that, on average, all free transactions fit in this reserved block space forever. I think that's a nice feature of the current fee policy, because it allows free transactions (psychologically appealing to users) for everyone who does not overuse their coins. No spamming or DoS possible.

But of course, I agree that the change makes the code much simpler.

@dgenr8
Copy link
Contributor

dgenr8 commented Jul 9, 2015

Design ACK

@rubensayshi
Copy link
Contributor

Concept ACK, I think the illusion that miners will mine TXs with 0 fee and high priority should be burned to the ground.

no matter what the blocksize debat does we'll eventually end up with fees being a significant part of miner revenue and I don't see miners maintaining the high priority policy at that point, might as well get rid of the code for it and since you're keeping some of the priority stuff left intact a miner who truely believe they wants to keep doing that could still do so.

CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
if (fLimitFree && nFees < txMinFee)
CAmount txMinFee = GetMinRelayFee(tx, nSize);
if (nFees < txMinFee)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If GetMinRelayFee returns 0 this error only triggers when new coins are being created, which is checked later in Consensus::CheckTxInputs later (which should be checked before doing any policy checks about inputs, see #6445 ).

If it returns minRelayTxFee, you're just repeating the check that is done a few lines later (if (nFees < ::minRelayTxFee.GetFee(nSize))).

Therefore this check and GetMinRelayFee() can be completely removed.

@dcousens
Copy link
Contributor

concept ACK, needs rebase

@jtimon
Copy link
Contributor

jtimon commented Aug 24, 2015

#6584 solves my nit here (and is rebased). It also includes #6445.
That of course means I utACK this one, I just prefer my version (where I remove GetMinRelayFee()).

@jgarzik
Copy link
Contributor Author

jgarzik commented Sep 15, 2015

Closing

@jgarzik jgarzik closed this Sep 15, 2015
@dcousens
Copy link
Contributor

@jgarzik for the same reasons as #6584?

@jgarzik
Copy link
Contributor Author

jgarzik commented Sep 15, 2015

The effort of frequent rebasing isn't worth keeping this open.

@dcousens
Copy link
Contributor

@jgarzik is there any consensus on the change? It seems wrong to close this unless the concept has been rejected?
@laanwj if I were to pick up this PR, would it be worth keeping open in light of #6584?

@jgarzik
Copy link
Contributor Author

jgarzik commented Sep 15, 2015

As a general principle, we probably don't want big pull requests to linger for a long time. This is straightforward to regenerate.

@pstratem
Copy link
Contributor

@jgarzik Is there an issue for this?

@jgarzik
Copy link
Contributor Author

jgarzik commented Sep 15, 2015

@pstratem Good point - an issue would probably be appropriate, linking to this outdated branch as an example.

@wallclockbuilder
Copy link

Concept ACK. Simplicity FTW!

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet