diff --git a/pom.xml b/pom.xml index 6b87f707..9eedc712 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 3.6.1 3.4.2 1.1.0 - 2.17.1 + 2.18.0 0.17 3.3.1 3.6.0 @@ -55,7 +55,7 @@ 1.17 1.7.36 2.0.10 - 5.17.14 + 5.18.2 1.2 1.10 diff --git a/src/main/java/org/qortal/account/Account.java b/src/main/java/org/qortal/account/Account.java index 8d79e3c8..2cc031fe 100644 --- a/src/main/java/org/qortal/account/Account.java +++ b/src/main/java/org/qortal/account/Account.java @@ -219,6 +219,7 @@ public class Account { int level = accountData.getLevel(); int groupIdToMint = BlockChain.getInstance().getMintingGroupId(); int groupCheckHeight = BlockChain.getInstance().getGroupMemberCheckHeight(); + int removeNameCheckHeight = BlockChain.getInstance().getRemoveOnlyMintWithNameHeight(); String myAddress = accountData.getAddress(); List myName = nameRepository.getNamesByOwner(myAddress); @@ -236,7 +237,11 @@ public class Account { return true; // Can only mint if have registered a name and is member of minter group id - if (blockchainHeight >= groupCheckHeight && level >= levelToMint && !myName.isEmpty() && isMember) + if (blockchainHeight >= groupCheckHeight && blockchainHeight < removeNameCheckHeight && level >= levelToMint && !myName.isEmpty() && isMember) + return true; + + // Can only mint if is member of minter group id + if (blockchainHeight >= removeNameCheckHeight && level >= levelToMint && isMember) return true; // Founders needs to pass same tests like minters @@ -253,12 +258,19 @@ public class Account { return true; if (blockchainHeight >= groupCheckHeight && + blockchainHeight < removeNameCheckHeight && Account.isFounder(accountData.getFlags()) && accountData.getBlocksMintedPenalty() == 0 && !myName.isEmpty() && isMember) return true; + if (blockchainHeight >= removeNameCheckHeight && + Account.isFounder(accountData.getFlags()) && + accountData.getBlocksMintedPenalty() == 0 && + isMember) + return true; + return false; } diff --git a/src/main/java/org/qortal/block/BlockChain.java b/src/main/java/org/qortal/block/BlockChain.java index 451d7c98..34097f0f 100644 --- a/src/main/java/org/qortal/block/BlockChain.java +++ b/src/main/java/org/qortal/block/BlockChain.java @@ -71,6 +71,7 @@ public class BlockChain { transactionV6Timestamp, disableReferenceTimestamp, increaseOnlineAccountsDifficultyTimestamp, + decreaseOnlineAccountsDifficultyTimestamp, onlineAccountMinterLevelValidationHeight, selfSponsorshipAlgoV1Height, selfSponsorshipAlgoV2Height, @@ -85,6 +86,7 @@ public class BlockChain { disableRewardshareHeight, enableRewardshareHeight, onlyMintWithNameHeight, + removeOnlyMintWithNameHeight, groupMemberCheckHeight } @@ -217,6 +219,10 @@ public class BlockChain { * featureTriggers because unit tests need to set this value via Reflection. */ private long onlineAccountsModulusV2Timestamp; + /** Feature trigger timestamp for ONLINE_ACCOUNTS_MODULUS time interval decrease. Can't use + * featureTriggers because unit tests need to set this value via Reflection. */ + private long onlineAccountsModulusV3Timestamp; + /** Snapshot timestamp for self sponsorship algo V1 */ private long selfSponsorshipAlgoV1SnapshotTimestamp; @@ -403,6 +409,10 @@ public class BlockChain { return this.onlineAccountsModulusV2Timestamp; } + public long getOnlineAccountsModulusV3Timestamp() { + return this.onlineAccountsModulusV3Timestamp; + } + /* Block reward batching */ public long getBlockRewardBatchStartHeight() { return this.blockRewardBatchStartHeight; @@ -579,6 +589,10 @@ public class BlockChain { return this.featureTriggers.get(FeatureTrigger.increaseOnlineAccountsDifficultyTimestamp.name()).longValue(); } + public long getDecreaseOnlineAccountsDifficultyTimestamp() { + return this.featureTriggers.get(FeatureTrigger.decreaseOnlineAccountsDifficultyTimestamp.name()).longValue(); + } + public int getSelfSponsorshipAlgoV1Height() { return this.featureTriggers.get(FeatureTrigger.selfSponsorshipAlgoV1Height.name()).intValue(); } @@ -635,6 +649,10 @@ public class BlockChain { return this.featureTriggers.get(FeatureTrigger.onlyMintWithNameHeight.name()).intValue(); } + public int getRemoveOnlyMintWithNameHeight() { + return this.featureTriggers.get(FeatureTrigger.removeOnlyMintWithNameHeight.name()).intValue(); + } + public int getGroupMemberCheckHeight() { return this.featureTriggers.get(FeatureTrigger.groupMemberCheckHeight.name()).intValue(); } diff --git a/src/main/java/org/qortal/controller/OnlineAccountsManager.java b/src/main/java/org/qortal/controller/OnlineAccountsManager.java index 97af8627..5572dee1 100644 --- a/src/main/java/org/qortal/controller/OnlineAccountsManager.java +++ b/src/main/java/org/qortal/controller/OnlineAccountsManager.java @@ -44,6 +44,7 @@ public class OnlineAccountsManager { */ private static final long ONLINE_TIMESTAMP_MODULUS_V1 = 5 * 60 * 1000L; private static final long ONLINE_TIMESTAMP_MODULUS_V2 = 30 * 60 * 1000L; + private static final long ONLINE_TIMESTAMP_MODULUS_V3 = 10 * 60 * 1000L; /** * How many 'current' timestamp-sets of online accounts we cache. @@ -67,12 +68,13 @@ public class OnlineAccountsManager { private static final long ONLINE_ACCOUNTS_COMPUTE_INITIAL_SLEEP_INTERVAL = 30 * 1000L; // ms // MemoryPoW - mainnet - public static final int POW_BUFFER_SIZE = 1 * 1024 * 1024; // bytes + public static final int POW_BUFFER_SIZE = 1024 * 1024; // bytes public static final int POW_DIFFICULTY_V1 = 18; // leading zero bits public static final int POW_DIFFICULTY_V2 = 19; // leading zero bits + public static final int POW_DIFFICULTY_V3 = 6; // leading zero bits // MemoryPoW - testnet - public static final int POW_BUFFER_SIZE_TESTNET = 1 * 1024 * 1024; // bytes + public static final int POW_BUFFER_SIZE_TESTNET = 1024 * 1024; // bytes public static final int POW_DIFFICULTY_TESTNET = 5; // leading zero bits // IMPORTANT: if we ever need to dynamically modify the buffer size using a feature trigger, the @@ -106,11 +108,15 @@ public class OnlineAccountsManager { public static long getOnlineTimestampModulus() { Long now = NTP.getTime(); - if (now != null && now >= BlockChain.getInstance().getOnlineAccountsModulusV2Timestamp()) { + if (now != null && now >= BlockChain.getInstance().getOnlineAccountsModulusV2Timestamp() && now < BlockChain.getInstance().getOnlineAccountsModulusV3Timestamp()) { return ONLINE_TIMESTAMP_MODULUS_V2; } + if (now != null && now >= BlockChain.getInstance().getOnlineAccountsModulusV3Timestamp()) { + return ONLINE_TIMESTAMP_MODULUS_V3; + } return ONLINE_TIMESTAMP_MODULUS_V1; } + public static Long getCurrentOnlineAccountTimestamp() { Long now = NTP.getTime(); if (now == null) @@ -135,9 +141,12 @@ public class OnlineAccountsManager { if (Settings.getInstance().isTestNet()) return POW_DIFFICULTY_TESTNET; - if (timestamp >= BlockChain.getInstance().getIncreaseOnlineAccountsDifficultyTimestamp()) + if (timestamp >= BlockChain.getInstance().getIncreaseOnlineAccountsDifficultyTimestamp() && timestamp < BlockChain.getInstance().getDecreaseOnlineAccountsDifficultyTimestamp()) return POW_DIFFICULTY_V2; + if (timestamp >= BlockChain.getInstance().getDecreaseOnlineAccountsDifficultyTimestamp()) + return POW_DIFFICULTY_V3; + return POW_DIFFICULTY_V1; } diff --git a/src/main/resources/blockchain.json b/src/main/resources/blockchain.json index 013a6bc9..b0c2df5b 100644 --- a/src/main/resources/blockchain.json +++ b/src/main/resources/blockchain.json @@ -29,6 +29,7 @@ "onlineAccountSignaturesMinLifetime": 43200000, "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 1659801600000, + "onlineAccountsModulusV3Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 1670230000000, "selfSponsorshipAlgoV2SnapshotTimestamp": 1708360200000, "selfSponsorshipAlgoV3SnapshotTimestamp": 1708432200000, @@ -95,6 +96,7 @@ "transactionV6Timestamp": 9999999999999, "disableReferenceTimestamp": 1655222400000, "increaseOnlineAccountsDifficultyTimestamp": 9999999999999, + "decreaseOnlineAccountsDifficultyTimestamp": 9999999999999, "onlineAccountMinterLevelValidationHeight": 1092000, "selfSponsorshipAlgoV1Height": 1092400, "selfSponsorshipAlgoV2Height": 1611200, @@ -109,6 +111,7 @@ "disableRewardshareHeight": 1899100, "enableRewardshareHeight": 1905100, "onlyMintWithNameHeight": 1900300, + "removeOnlyMintWithNameHeight": 9999999, "groupMemberCheckHeight": 1902700 }, "checkpoints": [