1

I discovered this term FEE_PER_KB_OLD in the code base, but it seems unused. What is the historical context around it? Was it ever used? I know in v3 of protocol the FEE_PER_KB was used, then in v4 it changed to the first iteration of the current dynamic fee algorithm. Was FEE_PER_KB used from the beginning?

Also, it sounds like the minimum fee is not enforced at the protocol level, just by node consensus (won't relay transactions with fees below the minimum). Was there a time where fees were ignored?

1 Answer 1

2

I discovered this term FEE_PER_KB_OLD in the code base, but it seems unused.

It is unused.

What is the historical context around it? Was it ever used?

It was used (or rather its value was used), until PR #1074 (Sep 15, 2016), where the definition was added (relevant part of #1074):

-#define FEE_PER_KB                      ((uint64_t)10000000000) // pow(10, 10)
+#define FEE_PER_KB_OLD                  ((uint64_t)10000000000) // pow(10, 10)
+#define FEE_PER_KB                      ((uint64_t)2000000000) // 2 * pow(10, 9)

Was FEE_PER_KB used from the beginning?

Not quite. It was added in PR #184 (Nov 7, 2014).

Also, it sounds like the minimum fee is not enforced at the protocol level, just by node consensus (won't relay transactions with fees below the minimum).

The minimum fee is enforced by the consensus protocol, whereby nodes will not relay transactions that do not have the minimum fee. If a miner however edited the code to allow zero-fee transactions and happens to mine one in a block, the block can still be accepted.

Was there a time where fees were ignored?

Fees were never ignored, although there was no minimum tx fee enforcement initially; this was added a few months later in commit d9f3421ce7 (Jul 17, 2014).

3
  • May want to clarify that 0.01 fee per KB was added early in v1 of protocol, then changed to 0.002/kB in v3.
    – koe
    Commented Dec 28, 2019 at 8:05
  • ^ The first part of the answer links to the precise commit where it was changed and quotes the relevant section. Clicking the links also shows the PR title "Decrease minimum fee from 0.01/kB to 0.002/kB". Your question also states what happened in v3. Regarding v1, that is detailed at the end of the answer.
    – jtgrassie
    Commented Dec 28, 2019 at 9:05
  • Fair enough ^.^
    – koe
    Commented Dec 28, 2019 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.