Merge pull request 'Add HAC option -ac_minopreturnfee to change OP_RETURN fee per tx, regardless of tx size, default is 1 coin' (#460) from jhendrix/hush3:ac_minopreturnfee into dev

Reviewed-on: https://git.hush.is/hush/hush3/pulls/460
This commit is contained in:
duke
2025-05-16 17:09:58 -04:00
4 changed files with 11 additions and 2 deletions

View File

@@ -51,6 +51,7 @@ std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY,DONAT
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA; uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA;
int8_t ASSETCHAINS_ADAPTIVEPOW; int8_t ASSETCHAINS_ADAPTIVEPOW;
uint8_t ASSETCHAINS_BURN = 0; uint8_t ASSETCHAINS_BURN = 0;
uint32_t ASSETCHAINS_MINOPRETURNFEE = 0;
std::vector<uint8_t> Mineropret; std::vector<uint8_t> Mineropret;
std::vector<std::string> vAllowListAddress; std::vector<std::string> vAllowListAddress;
char NOTARYADDRS[64][64]; char NOTARYADDRS[64][64];

View File

@@ -1842,6 +1842,7 @@ void hush_args(char *argv0)
Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0); Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0);
ASSETCHAINS_BURN = GetArg("-ac_burn", 0); ASSETCHAINS_BURN = GetArg("-ac_burn", 0);
ASSETCHAINS_MINOPRETURNFEE = GetArg("-ac_minopreturnfee", 0);
// -ac_ccactivateht=evalcode,height,evalcode,height,evalcode,height.... // -ac_ccactivateht=evalcode,height,evalcode,height,evalcode,height....
Split(GetArg("-ac_ccactivateht",""), sizeof(ccEnablesHeight)/sizeof(*ccEnablesHeight), ccEnablesHeight, 0); Split(GetArg("-ac_ccactivateht",""), sizeof(ccEnablesHeight)/sizeof(*ccEnablesHeight), ccEnablesHeight, 0);

View File

@@ -604,6 +604,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-ac_blocktime", _("Block time in seconds, default is 60")); strUsage += HelpMessageOpt("-ac_blocktime", _("Block time in seconds, default is 60"));
strUsage += HelpMessageOpt("-ac_beam", _("BEAM integration")); strUsage += HelpMessageOpt("-ac_beam", _("BEAM integration"));
strUsage += HelpMessageOpt("-ac_burn", _("Allow sending funds to the transparent burn address when -ac_private=1")); strUsage += HelpMessageOpt("-ac_burn", _("Allow sending funds to the transparent burn address when -ac_private=1"));
strUsage += HelpMessageOpt("-ac_minopreturnfee", _("OP_RETURN minimum fee per tx, regardless of tx size, default is 1 coin"));
strUsage += HelpMessageOpt("-ac_coda", _("CODA integration")); strUsage += HelpMessageOpt("-ac_coda", _("CODA integration"));
strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving")); strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving"));
strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end")); strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end"));

View File

@@ -118,6 +118,7 @@ public:
extern int8_t ASSETCHAINS_ADAPTIVEPOW; extern int8_t ASSETCHAINS_ADAPTIVEPOW;
extern uint32_t ASSETCHAINS_RANDOMX; extern uint32_t ASSETCHAINS_RANDOMX;
extern uint32_t ASSETCHAINS_MINOPRETURNFEE;
extern bool fRandomXDebug; extern bool fRandomXDebug;
extern std::string devtax_scriptpub_for_height(uint32_t nHeight); extern std::string devtax_scriptpub_for_height(uint32_t nHeight);
@@ -521,6 +522,11 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
// Opret spam limits // Opret spam limits
CAmount opretMinFee = 1 * COIN; CAmount opretMinFee = 1 * COIN;
// Set with -ac_minopreturnfee
if (ASSETCHAINS_MINOPRETURNFEE > 0) {
opretMinFee = ASSETCHAINS_MINOPRETURNFEE;
}
{ {
bool fSpamTx = false; bool fSpamTx = false;
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);