Skip to content

Commit

Permalink
reschedule lydra fork for mainnet, fix tx size policy, fix default me…
Browse files Browse the repository at this point in the history
…mpool expiration time
  • Loading branch information
RosenKrumov committed Jun 19, 2023
1 parent 385ff9d commit 49b7b49
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,10 @@ class CMainParams : public CChainParams {
consensus.nRewardOffsetHeight = 658600;
consensus.nRewardOffsetAmount = 33018156505135300;
consensus.nContractOutsHeight = 852800;
consensus.nRefundFixHeight = 1119900;
consensus.nLydraHeight = 0x7fffffff;
// consensus.lydraAddress = uint160(ParseHex("")); // LYDRA token address
consensus.lydraAddress = uint160(ParseHex("ffffffffffffffffffffffffffffffffffffffff")); // LYDRA token address
consensus.nDelegationsGasFixHeight = 0x7fffffff;
consensus.nRefundFixHeight = 1160400;
consensus.nLydraHeight = 1160400;
consensus.lydraAddress = uint160(ParseHex("68a674e10694eeb00867d2e11c8b158b00b28e96")); // LYDRA token address
consensus.nDelegationsGasFixHeight = 1160400;

consensus.BIP34Hash = uint256S("0x000058b8d49cd33ae70558978ff60269d4de7d4b50ac1f733631765e4207a457");
// consensus.BIP65Height: 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0
Expand Down
2 changes: 1 addition & 1 deletion src/policy/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = 7600000;
/** Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by mining code **/
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 400000;
/** The maximum weight for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_WEIGHT = 50000;
static const unsigned int MAX_STANDARD_TX_WEIGHT = 200000;
/** The minimum non-witness size for transactions we're willing to relay/mine (1 segwit input + 1 P2WPKH output = 82 bytes) */
static const unsigned int MIN_STANDARD_TX_NONWITNESS_SIZE = 82;
/** Maximum number of signature check operations in an IsStandard() P2SH script */
Expand Down
6 changes: 3 additions & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static void UpdateMempoolForReorg(DisconnectedBlockTransactions& disconnectpool,
// We also need to remove any now-immature transactions
mempool.removeForReorg(pcoinsTip.get(), chainActive.Tip()->nHeight + 1, STANDARD_LOCKTIME_VERIFY_FLAGS);
// Re-limit mempool size, in case we added any transactions
LimitMempoolSize(mempool, gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60);
LimitMempoolSize(mempool, gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 30 * 60);
}

// Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool
Expand Down Expand Up @@ -1215,7 +1215,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
// trim mempool and check if tx was trimmed
if (!bypass_limits) {
LimitMempoolSize(pool, gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000,
gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60);
gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 30 * 60);
if (!pool.exists(hash))
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "mempool full");
}
Expand Down Expand Up @@ -7308,7 +7308,7 @@ static const uint64_t MEMPOOL_DUMP_VERSION = 1;
bool LoadMempool()
{
const CChainParams& chainparams = Params();
int64_t nExpiryTimeout = gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60;
int64_t nExpiryTimeout = gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 30 * 60;
FILE* filestr = fsbridge::fopen(GetDataDir() / "mempool.dat", "rb");
CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);
if (file.IsNull()) {
Expand Down
2 changes: 1 addition & 1 deletion src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static const unsigned int DEFAULT_DESCENDANT_LIMIT = 25;
/** Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT = 101;
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336;
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 1;
/** Maximum kilobytes for transactions to store for processing during reorg */
static const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE = 20000;
/** The maximum size of a blk?????.dat file (since 0.8) */
Expand Down
3 changes: 2 additions & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3648,7 +3648,8 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std

// Limit size
if (GetTransactionWeight(*tx) > MAX_STANDARD_TX_WEIGHT)
{ auto failReasonStr = "Transaction too large and exceeds max " + std::to_string(MAX_STANDARD_TX_WEIGHT/1000) + "KB size. Try doing it in several smaller transactions or consolidate your UTXOs first.";
{
auto failReasonStr = "Transaction too large and exceeds max " + std::to_string(MAX_STANDARD_TX_WEIGHT/1000) + "KB size. Try doing it in several smaller transactions or consolidate your UTXOs first.";
strFailReason = _(failReasonStr.c_str());
return false;
}
Expand Down

0 comments on commit 49b7b49

Please sign in to comment.