This is a followup to
23991ee53 / https://github.com/bitcoin/bitcoin/pull/15600
to also use madvise(2) on FreeBSD to avoid sensitive data allocated
with secure_allocator ending up in core files in addition to preventing
it from going to the swap.
Discards any Qt built-in command line arguments and replaces them
with dummy argv that only contains the binary name. Solves CVE-2021-3401.
Manually ported from bitcoin/bitcoin@a2714a5c
Allows easy integration with mining software that expects either
a "_target" (Namecoin) or a "target" (Dogecoin) field when
creating auxpow blocks using the -rpcnamecoinapi startup arg.
This saves pools effort in integrating the API they need whenever
a new Dogecoin Core release comes out.
- RPC caching source cherry-picked from: btccom@f4b613b2
- Adds addl test scenarios to createauxblock.py tests
Allows pool operators to run multiple sub-pools with different
target addresses from a single dogecoind instance. Without this
enhancement, subsequent calls to createauxblock with differing
addresses ignore the address given and instead just return the
block containing the address that initially triggered generation
of the cached block. This can quickly lead to unpredictable
results as race scenarios between sub-pools come into play.
Note that, like with getauxblock, the cache only resets on aux
block creation, not submission, so submitauxblock will accept
multiple submissions at the same height until createauxblock is
called, resulting in chaintip forks.
Co-Authored-By: leezhen <jasper.li@bitmain.com>
Adds back Namecoin's createauxblock and submitauxblock rpc methods
to allow easier integration for mining pools that wish to reuse
existing implementations of Namecoin/Bitcoin merge mining.
Cherry-picked from: michilumin@1c5b9b33
Changes post-pick:
- Fixed issue with erroneously moved LOCK in getauxblock
- Disabled mining of witness tx as done for getauxblock
- Fixed indentation, increasing readability and fixing warnings
- Follow Dogecoin API for "target" instead of "_target"
- Remove personal comments
The timeout window for block downloads scales proportionally to the target
spacing for the chain, as set in chainparams.cpp. This causes issues on regtest
because the spacing is set to 1 second, allowing insufficient time for very
large blocks to sync when requested in batch, preventing success of the pruning
qa test.
We fix this by introducing a minimum multiplier (in seconds) that will be used
instead of the target block spacing whenever the latter is lower. With a value
of 10 seconds, pruning tests pass.
Removes "1.14" that was embedded in the logo image on the overview
screen and replaces it with a dynamically generated version in the
lower left corner.
Changes the dust policy to require transactions to add the dust
limit itself rather than the relay or wallet fee to the fees paid
when creating dust outputs.
This both disincentivizes dust outputs the same as before when dust
and minumum fee were equal and greatly simplifies the rule, as it
no longer requires 2 variables to calculate dust, but just one:
"If an output is under x, add x to the fee."
MIN_CHANGE influences the minimum change output size but was only
hardcoded and wallet users were not able to override this in any
way. This change retains the logic for the calculation as a
hardcoded constant but instead uses the user-configurable params
-discardthreshold and -mintxfee as a basis. The rationale for
having the minimum change equal to the discard threshold plus 2x
the minimum fee has not changed.
MIN_FINAL_CHANGE was a hardcoded limit that was impossible to be
changed by users. This causes problems when the dust limit is
changing because then a user would need a new release to be able
to have lower change outputs.
This commit replaces the entire notion of MIN_FINAL_CHANGE to just
follow the discard threshold, which can be set by the user using
-discardthreshold.
Sets the high tx fee to be higher than the default values
implemented by the wallet. The highest value from the QT coin
control slider is 5.21 DOGE.
Therefore, a 10 DOGE/kB high tx fee should suffice for now.
As of writing, 97% of the relay network (for me: 2251 of 2328
peers) enforces a 1 DOGE hard dust limit making attempts to send
smaller outputs extremely unlikely to make it through to miners.
This setting is a temporary measure until a significant portion of
the network accepts lower dust thresholds. The threshold can be
changed by wallet users using the -discardthreshold parameter.
DustRelayFee (-dustrelayfee) was used sporadically throughout the
code, even though it had been disabled for dust determination, but
has now completely been removed from all dust and fee related
queries. Therefore, it can be removed from the code.
Moves the warning from DUST_RELAY_TX_FEE to DEFAULT_HARD_DUST_LIMIT
as it is very relevant for the latter, but never was relevant for
the former as it was disabled for us.
Creates a wallet-specific, configurable dust limit that enables
gradual implementation of the dust limit. Each transaction created
with the wallet will adhere to this threshold rather than the dust
limits used for relay, so that the wallet stays usable while the
network changes (lowers) its dust limits.
This change only implements the parameter but does not change its
default value.
Creates a new parameter, -harddustlimit, that is used for testing
standard transactions. The default is set at 1/10th of the (soft)
dust limit, to be the same as the default minimum relay fee and
leave space for future improvements.
The existing dust limit (-dustlimit) is now enforcing the economic
disincentive under which each output under the limit must add
additional fee to be accepted to the mempool. Before this commit,
-dustlimit enforced both the hard and the soft limits, which
effectively removed the soft limit altogether.
Prepares for having more than one dust limit configured, yet
allowing the same function to return whether or not an output is
dust.
Implements the check with nDustLimit (-dustlimit) for relay related
queries, and - for lack of alternatives - uses the same parameter
for CWallet::GetRequiredFee until a wallet-specific dust limit is
introduced