I am programatically calculating fees for transactions.
AFAIK, bakers by default adhere to the following fee calculation:
fees >= (minimal_fees + minimal_nanotez_per_byte * size + minimal_nanotez_per_gas_unit * gas)
where
minimal_fees = 0.000 1ꜩ (100µꜩ)
minimal_nanotez_per_gas_unit = 100nꜩ/gu (0.000 000 1ꜩ/gu)
minimal_nanotez_per_byte = 1000nꜩ/B (0.000 001ꜩ/B)
(Source)
Today, I had a transaction which timed out in the mempool. The transaction used 66754 gas units and 234 bytes of storage.
Based on the above, I think that the proposed fee of 0.00701XTZ should have been sufficient to get included in a block:
minimal fees = .000001
gas fees = 66745 * 100nꜩ/gu = .006676 (rounded up)
storage fees = 234 * 1000nꜩ/B = .000234
----------------------------------------------
total = .00701
Why was this transaction not included in a block?