Subject: Re: [bitcoin-dev] Composite priority: combining fees and bitcoin-days into one number

From: Luke Dashjr <[email-masked]>
Date: Thu, 29 Oct 2015 00:55:53 +0000

On Wednesday, October 28, 2015 10:41:39 PM Jonathan Toomim wrote:
> On Oct 28, 2015, at 12:13 AM, Luke Dashjr <[email-masked]> wrote:
> > On Wednesday, October 28, 2015 4:26:52 AM Jonathan Toomim via bitcoin-dev
> > wrote:
> > 
> > This is all in the realm of node policy, which must be easy to
> > modify/customise in a flexible manner. So simplifying other code in a way
> > that makes the policy harder to configure is not a welcome change.
> > 
> > That is, by making the code simpler, if you make custom policies (such as
> > the current default) harder, it is better to leave the main code less
> > simple.
> 
> I think the only custom policy that this change would make harder to
> implement is the current default policy of 5% reserved space. Right now,
> in e.g. CreateNewBlock, you have two loops, each of which follows a
> completely different policy, plus additional code for corner cases like
> ensuring that a tx isn't added twice. If I were a miner and a mediocre
> programmer (which I actually am, on both accounts), and I wanted to change
> the mining policy, I would probably take a look at that code, groan, give
> up, and go sharpen my pickaxe instead.

Yes, I hope to improve the code significantly.

> This change could be written in an abstract way. We could define an API
> that is calibrated on the whole mempool, then has a method that takes
> transactions and returns priority scores.

Trying to communicate policies as simple numbers is significantly more 
complicated for the policy-writer than what we have now.

> If someone wanted to write a reserved-space algorithm in this priority API
> scheme, then they could just set it up so that most transactions would get
> a priority score between e.g. zero and 8999, and any transactions that
> were supposed to be prioritized would get a priority level over 9000. Easy
> enough?

No, because it gets exponentially harder when there are more than two factors 
involved.

Luke