oxen-core/src/cryptonote_basic
Jason Rhinelander 6a886b69ea Generic burn fee checking + blink burn fee checking
This adds the ability for check_fee() to also check the burn amount.
This requires passing extra info through `add_tx()` (and the various
things that call it), so I took the:

    bool keeped_by_block, bool relayed, bool do_not_relay

argument triplet, moved it into a struct in tx_pool.h, then added the other fee
options there (along with some static factory functions for generating the
typical sets of option).

The majority of this commit is chasing that change through the codebase and
test suite.

This is used by blink but should also help LNS and other future burn
transactions to verify a burn amount simply when adding the transation to the
mempool.  It supports a fixed burn amount, a burn amount as a multiple of the
minimum tx fee, and also allows you to increase the minimum tx fee (so that,
for example, we could require blink txes to pay miners 250% of the usual
minimum (unimportant) priority tx fee.

- Removed a useless core::add_new_tx() overload that wasn't used anywhere.

Blink-specific changes:

(I'd normally separate these into a separate commit, but they got interwoven
fairly heavily with the above change).

- changed the way blink burning is specified so that we have three knobs for
fee adjustment (fixed burn fee; base fee multiple; and required miner tx fee).
The fixed amount is currently 0, base fee is 400%, and require miner tx fee is
simply 100% (i.e. no different than a normal transaction).  This is the same as
before this commit, but is changing how they are being specified in
cryptonote_config.h.

- blink tx fee, burn amount, and miner tx fee (if > 100%) now get checked
before signing a blink tx.  (These fee checks don't apply to anyone else --
when propagating over the network only the miner tx fee is checked).

- Added a couple of checks for blink quorums: 1) make sure they have reached
the blink hf; 2) make sure the submitted tx version conforms to the current hf
min/max tx version.

- print blink fee information in simplewallet's `fee` output

- add "typical" fee calculations in the `fee` output:

    [wallet T6SCwL (has locked stakes)]: fee
    Current fee is 0.000000850 loki per byte + 0.020000000 loki per output
    No backlog at priority 1
    No backlog at priority 2
    No backlog at priority 3
    No backlog at priority 4
    Current blink fee is 0.000004250 loki per byte + 0.100000000 loki per output
    Estimated typical small transaction fees: 0.042125000 (unimportant), 0.210625000 (normal), 1.053125000 (elevated), 5.265625000 (priority), 0.210625000 (blink)

where "small" here is the same tx size (2500 bytes + 2 outputs) used to
estimate backlogs.
2019-11-27 14:23:56 -04:00
..
account.cpp Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
account.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
account_boost_serialization.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
blobdatatype.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
CMakeLists.txt Move miner.h to fix cn basic referencing core and core referencing basic (#679) 2019-06-27 19:15:58 +10:00
connection_context.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
cryptonote_basic.h Remove default from get_{min,max}_version_for_hf 2019-11-27 14:23:56 -04:00
cryptonote_basic_impl.cpp Add cfenv header for block reward calculation to set rounding 2019-10-09 13:09:21 +11:00
cryptonote_basic_impl.h Distinguish pop_blocks from reorg in detach hook 2019-10-16 10:25:04 +11:00
cryptonote_boost_serialization.h Add & use tools::enum_count to get _count as underlying type 2019-11-27 14:07:52 -04:00
cryptonote_format_utils.cpp Generic burn fee checking + blink burn fee checking 2019-11-27 14:23:56 -04:00
cryptonote_format_utils.h Generic burn fee checking + blink burn fee checking 2019-11-27 14:23:56 -04:00
cryptonote_stat_info.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
difficulty.cpp Cap difficulty at 30MH/s for first 60 v12 blocks (#677) 2019-06-27 17:05:32 +10:00
difficulty.h Cap difficulty at 30MH/s for first 60 v12 blocks (#677) 2019-06-27 17:05:32 +10:00
hardfork.cpp Add quorumnet comms 2019-11-27 14:07:45 -04:00
hardfork.h Report portential decomission and recommission for your node 2019-09-19 17:46:21 +10:00
subaddress_index.h Add missing LOKI_RPC_DOC_INTROSPECT annotations (#776) 2019-08-07 10:41:55 +10:00
tx_extra.h Add fee burning 2019-10-30 18:47:22 -03:00
verification_context.h Reward fudge factor (#867) 2019-10-04 13:57:14 +10:00