diff --git a/pom.xml b/pom.xml index a17fd5e3..eb797523 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.qortal qortal - 4.4.2 + 4.5.0 jar true diff --git a/src/main/java/org/qortal/account/SelfSponsorshipAlgoV1.java b/src/main/java/org/qortal/account/SelfSponsorshipAlgoV1.java index 2ed57f34..65092602 100644 --- a/src/main/java/org/qortal/account/SelfSponsorshipAlgoV1.java +++ b/src/main/java/org/qortal/account/SelfSponsorshipAlgoV1.java @@ -2,7 +2,6 @@ package org.qortal.account; import org.qortal.api.resource.TransactionsResource; import org.qortal.asset.Asset; -import org.qortal.block.BlockChain; import org.qortal.data.account.AccountData; import org.qortal.data.naming.NameData; import org.qortal.data.transaction.*; @@ -27,7 +26,6 @@ public class SelfSponsorshipAlgoV1 { private int consolidationCount = 0; private int bulkIssuanceCount = 0; private int recentSponsorshipCount = 0; - private int transferAssetsCount = 0; private List sponsorshipRewardShares = new ArrayList<>(); private final Map> paymentsByAddress = new HashMap<>(); @@ -35,7 +33,6 @@ public class SelfSponsorshipAlgoV1 { private Set consolidatedAddresses = new LinkedHashSet<>(); private final Set zeroTransactionAddreses = new LinkedHashSet<>(); private final Set penaltyAddresses = new LinkedHashSet<>(); - private final Set transferAssetsByAddress = new LinkedHashSet<>(); public SelfSponsorshipAlgoV1(Repository repository, String address, long snapshotTimestamp, boolean override) throws DataException { this.repository = repository; @@ -70,7 +67,6 @@ public class SelfSponsorshipAlgoV1 { this.findBulkIssuance(); this.findRegisteredNameCount(); this.findRecentSponsorshipCount(); - this.transferAssetsCount = this.transferAssetsByAddress.size(); int score = this.calculateScore(); if (score <= 0 && !override) { @@ -225,9 +221,7 @@ public class SelfSponsorshipAlgoV1 { } private void findRecentSponsorshipCount() { - long snapshotTimestampBefore = BlockChain.getInstance().getSelfSponsorshipAlgoV1SnapshotTimestamp(); - long diffTimeBetween = this.snapshotTimestamp - snapshotTimestampBefore; - final long referenceTimestamp = this.snapshotTimestamp - diffTimeBetween; + final long referenceTimestamp = this.snapshotTimestamp - (365 * 24 * 60 * 60 * 1000L); int recentSponsorshipCount = 0; for (RewardShareTransactionData rewardShare : sponsorshipRewardShares) { if (rewardShare.getTimestamp() >= referenceTimestamp) { @@ -238,13 +232,12 @@ public class SelfSponsorshipAlgoV1 { } private int calculateScore() { - final int transferAssetsMultiplier = (this.transferAssetsCount >= 5) ? 10 : 1; final int suspiciousMultiplier = (this.suspiciousCount >= 100) ? this.suspiciousPercent : 1; final int nameMultiplier = (this.sponsees.size() >= 50 && this.registeredNameCount == 0) ? 2 : 1; final int consolidationMultiplier = Math.max(this.consolidationCount, 1); final int bulkIssuanceMultiplier = Math.max(this.bulkIssuanceCount / 2, 1); final int offset = 9; - return transferAssetsMultiplier * suspiciousMultiplier * nameMultiplier * consolidationMultiplier * bulkIssuanceMultiplier - offset; + return suspiciousMultiplier * nameMultiplier * consolidationMultiplier * bulkIssuanceMultiplier - offset; } private void fetchSponsorshipRewardShares() throws DataException { @@ -329,7 +322,6 @@ public class SelfSponsorshipAlgoV1 { if (!Objects.equals(transferAssetTransactionData.getRecipient(), address)) { // Outgoing payment from this account outgoingPaymentRecipients.add(transferAssetTransactionData.getRecipient()); - this.transferAssetsByAddress.add(transferAssetTransactionData.getRecipient()); } } break; diff --git a/src/main/java/org/qortal/api/resource/PollsResource.java b/src/main/java/org/qortal/api/resource/PollsResource.java index 2b9020ab..8b00d3cd 100644 --- a/src/main/java/org/qortal/api/resource/PollsResource.java +++ b/src/main/java/org/qortal/api/resource/PollsResource.java @@ -142,7 +142,7 @@ public class PollsResource { for (VoteOnPollData vote : votes) { String voter = Crypto.toAddress(vote.getVoterPublicKey()); AccountData voterData = repository.getAccountRepository().getAccount(voter); - int voteWeight = voterData.getBlocksMinted() - voterData.getBlocksMintedPenalty(); + int voteWeight = voterData.getBlocksMinted() + voterData.getBlocksMintedPenalty(); if (voteWeight < 0) voteWeight = 0; totalWeight += voteWeight; diff --git a/src/main/java/org/qortal/block/Block.java b/src/main/java/org/qortal/block/Block.java index 475de70a..22e6e9f1 100644 --- a/src/main/java/org/qortal/block/Block.java +++ b/src/main/java/org/qortal/block/Block.java @@ -1553,7 +1553,7 @@ public class Block { Block212937.processFix(this); } - if (this.blockData.getHeight() == BlockChain.getInstance().getUnconfirmableRewardSharesHeight()) { + if (this.blockData.getHeight() == BlockChain.getInstance().getSelfSponsorshipAlgoV1Height()) { SelfSponsorshipAlgoV1Block.processAccountPenalties(this); } } @@ -1840,12 +1840,14 @@ public class Block { // Invalidate expandedAccounts as they may have changed due to orphaning TRANSFER_PRIVS transactions, etc. this.cachedExpandedAccounts = null; - if (this.blockData.getHeight() == 212937) + if (this.blockData.getHeight() == 212937) { // Revert fix for block 212937 Block212937.orphanFix(this); + } - else if (this.blockData.getHeight() == BlockChain.getInstance().getSelfSponsorshipAlgoV1Height()) + if (this.blockData.getHeight() == BlockChain.getInstance().getSelfSponsorshipAlgoV1Height()) { SelfSponsorshipAlgoV1Block.orphanAccountPenalties(this); + } // Account levels and block rewards are only processed/orphaned on block reward distribution blocks if (this.isRewardDistributionBlock()) { @@ -2544,4 +2546,4 @@ public class Block { LOGGER.info(() -> String.format("Unable to log block debugging info: %s", e.getMessage())); } } -} \ No newline at end of file +} diff --git a/src/main/java/org/qortal/block/BlockChain.java b/src/main/java/org/qortal/block/BlockChain.java index 8013e7a5..eb98000e 100644 --- a/src/main/java/org/qortal/block/BlockChain.java +++ b/src/main/java/org/qortal/block/BlockChain.java @@ -73,10 +73,13 @@ public class BlockChain { increaseOnlineAccountsDifficultyTimestamp, onlineAccountMinterLevelValidationHeight, selfSponsorshipAlgoV1Height, + selfSponsorshipAlgoV2Height, feeValidationFixTimestamp, chatReferenceTimestamp, arbitraryOptionalFeeTimestamp, - unconfirmableRewardSharesHeight; + unconfirmableRewardSharesHeight, + disableTransferPrivsTimestamp, + enableTransferPrivsTimestamp } // Custom transaction fees @@ -199,6 +202,7 @@ public class BlockChain { /** Minimum time to retain online account signatures (ms) for block validity checks. */ private long onlineAccountSignaturesMinLifetime; + /** Maximum time to retain online account signatures (ms) for block validity checks, to allow for clock variance. */ private long onlineAccountSignaturesMaxLifetime; @@ -209,6 +213,9 @@ public class BlockChain { /** Snapshot timestamp for self sponsorship algo V1 */ private long selfSponsorshipAlgoV1SnapshotTimestamp; + /** Snapshot timestamp for self sponsorship algo V2 */ + private long selfSponsorshipAlgoV2SnapshotTimestamp; + /** Feature-trigger timestamp to modify behaviour of various transactions that support mempow */ private long mempowTransactionUpdatesTimestamp; @@ -225,6 +232,8 @@ public class BlockChain { * data and to base online accounts decisions on. */ private int blockRewardBatchAccountsBlockCount; + private String penaltyFixHash; + /** Max reward shares by block height */ public static class MaxRewardSharesByTimestamp { public long timestamp; @@ -267,7 +276,7 @@ public class BlockChain { try { // Create JAXB context aware of Settings jc = JAXBContextFactory.createContext(new Class[] { - BlockChain.class, GenesisBlock.GenesisInfo.class + BlockChain.class, GenesisBlock.GenesisInfo.class }, null); // Create unmarshaller @@ -395,12 +404,20 @@ public class BlockChain { return this.blockRewardBatchAccountsBlockCount; } + public String getPenaltyFixHash() { + return this.penaltyFixHash; + } - // Self sponsorship algo + // Self sponsorship algo V1 public long getSelfSponsorshipAlgoV1SnapshotTimestamp() { return this.selfSponsorshipAlgoV1SnapshotTimestamp; } + // Self sponsorship algo V2 + public long getSelfSponsorshipAlgoV2SnapshotTimestamp() { + return this.selfSponsorshipAlgoV2SnapshotTimestamp; + } + // Feature-trigger timestamp to modify behaviour of various transactions that support mempow public long getMemPoWTransactionUpdatesTimestamp() { return this.mempowTransactionUpdatesTimestamp; @@ -541,6 +558,10 @@ public class BlockChain { return this.featureTriggers.get(FeatureTrigger.selfSponsorshipAlgoV1Height.name()).intValue(); } + public int getSelfSponsorshipAlgoV2Height() { + return this.featureTriggers.get(FeatureTrigger.selfSponsorshipAlgoV2Height.name()).intValue(); + } + public long getOnlineAccountMinterLevelValidationHeight() { return this.featureTriggers.get(FeatureTrigger.onlineAccountMinterLevelValidationHeight.name()).intValue(); } @@ -561,6 +582,13 @@ public class BlockChain { return this.featureTriggers.get(FeatureTrigger.unconfirmableRewardSharesHeight.name()).intValue(); } + public long getDisableTransferPrivsTimestamp() { + return this.featureTriggers.get(FeatureTrigger.disableTransferPrivsTimestamp.name()).longValue(); + } + + public long getEnableTransferPrivsTimestamp() { + return this.featureTriggers.get(FeatureTrigger.enableTransferPrivsTimestamp.name()).longValue(); + } // More complex getters for aspects that change by height or timestamp @@ -747,7 +775,7 @@ public class BlockChain { /** * Some sort of start-up/initialization/checking method. - * + * * @throws SQLException */ public static void validate() throws DataException { diff --git a/src/main/java/org/qortal/block/SelfSponsorshipAlgoV1Block.java b/src/main/java/org/qortal/block/SelfSponsorshipAlgoV1Block.java index cea97593..27b50a81 100644 --- a/src/main/java/org/qortal/block/SelfSponsorshipAlgoV1Block.java +++ b/src/main/java/org/qortal/block/SelfSponsorshipAlgoV1Block.java @@ -28,7 +28,6 @@ public final class SelfSponsorshipAlgoV1Block { private static final Logger LOGGER = LogManager.getLogger(SelfSponsorshipAlgoV1Block.class); - private SelfSponsorshipAlgoV1Block() { /* Do not instantiate */ } @@ -64,7 +63,7 @@ public final class SelfSponsorshipAlgoV1Block { } public static Set getAccountPenalties(Repository repository, int penalty) throws DataException { - final long snapshotTimestamp = System.currentTimeMillis() - 10000; + final long snapshotTimestamp = BlockChain.getInstance().getSelfSponsorshipAlgoV1SnapshotTimestamp(); Set penalties = new LinkedHashSet<>(); List addresses = repository.getTransactionRepository().getConfirmedRewardShareCreatorsExcludingSelfShares(); for (String address : addresses) { @@ -132,4 +131,5 @@ public final class SelfSponsorshipAlgoV1Block { Collections.sort(penaltyAddresses); return Base58.encode(Crypto.digest(StringUtils.join(penaltyAddresses).getBytes(StandardCharsets.UTF_8))); } -} + +} \ No newline at end of file diff --git a/src/main/java/org/qortal/crosschain/Bitcoin.java b/src/main/java/org/qortal/crosschain/Bitcoin.java index e11dde0b..79ab38af 100644 --- a/src/main/java/org/qortal/crosschain/Bitcoin.java +++ b/src/main/java/org/qortal/crosschain/Bitcoin.java @@ -44,74 +44,62 @@ public class Bitcoin extends Bitcoiny { return Arrays.asList( // Servers chosen on NO BASIS WHATSOEVER from various sources! // Status verified at https://1209k.com/bitcoin-eye/ele.php?chain=btc - new Server("104.248.139.211", Server.ConnectionType.SSL, 50002), + new Server("104.198.149.61", Server.ConnectionType.SSL, 50002), new Server("128.0.190.26", Server.ConnectionType.SSL, 50002), - new Server("142.93.6.38", Server.ConnectionType.SSL, 50002), new Server("157.245.172.236", Server.ConnectionType.SSL, 50002), - new Server("167.172.226.175", Server.ConnectionType.SSL, 50002), - new Server("167.172.42.31", Server.ConnectionType.SSL, 50002), - new Server("178.62.80.20", Server.ConnectionType.SSL, 50002), - new Server("185.64.116.15", Server.ConnectionType.SSL, 50002), - new Server("188.165.206.215", Server.ConnectionType.SSL, 50002), - new Server("188.165.211.112", Server.ConnectionType.SSL, 50002), - new Server("2azzarita.hopto.org", Server.ConnectionType.SSL, 50002), - new Server("2electrumx.hopto.me", Server.ConnectionType.SSL, 56022), - new Server("2ex.digitaleveryware.com", Server.ConnectionType.SSL, 50002), - new Server("65.39.140.37", Server.ConnectionType.SSL, 50002), - new Server("68.183.188.105", Server.ConnectionType.SSL, 50002), - new Server("71.73.14.254", Server.ConnectionType.SSL, 50002), - new Server("94.23.247.135", Server.ConnectionType.SSL, 50002), - new Server("assuredly.not.fyi", Server.ConnectionType.SSL, 50002), - new Server("ax101.blockeng.ch", Server.ConnectionType.SSL, 50002), - new Server("ax102.blockeng.ch", Server.ConnectionType.SSL, 50002), + new Server("260.whyza.net", Server.ConnectionType.SSL, 50002), + new Server("34.136.93.37", Server.ConnectionType.SSL, 50002), + new Server("34.67.22.216", Server.ConnectionType.SSL, 50002), + new Server("34.68.133.78", Server.ConnectionType.SSL, 50002), + new Server("alviss.coinjoined.com", Server.ConnectionType.SSL, 50002), new Server("b.1209k.com", Server.ConnectionType.SSL, 50002), new Server("b6.1209k.com", Server.ConnectionType.SSL, 50002), new Server("bitcoin.dermichi.com", Server.ConnectionType.SSL, 50002), new Server("bitcoin.lu.ke", Server.ConnectionType.SSL, 50002), new Server("bitcoin.lukechilds.co", Server.ConnectionType.SSL, 50002), new Server("blkhub.net", Server.ConnectionType.SSL, 50002), - new Server("btc.electroncash.dk", Server.ConnectionType.SSL, 60002), + new Server("btc.aftrek.org", Server.ConnectionType.SSL, 50002), + new Server("btc.hodler.ninja", Server.ConnectionType.SSL, 50002), new Server("btc.ocf.sh", Server.ConnectionType.SSL, 50002), new Server("btce.iiiiiii.biz", Server.ConnectionType.SSL, 50002), new Server("caleb.vegas", Server.ConnectionType.SSL, 50002), + new Server("d762li0k0g.d.firewalla.org", Server.ConnectionType.SSL, 50002), + new Server("de.poiuty.com", Server.ConnectionType.SSL, 50002), + new Server("dijon.anties.org", Server.ConnectionType.SSL, 50002), new Server("eai.coincited.net", Server.ConnectionType.SSL, 50002), - new Server("electrum.bhoovd.com", Server.ConnectionType.SSL, 50002), new Server("electrum.bitaroo.net", Server.ConnectionType.SSL, 50002), - new Server("electrum.bitcoinlizard.net", Server.ConnectionType.SSL, 50002), - new Server("electrum.blockstream.info", Server.ConnectionType.SSL, 50002), + new Server("electrum.bitrefill.com", Server.ConnectionType.SSL, 50002), + new Server("electrum.brainshome.de", Server.ConnectionType.SSL, 50002), new Server("electrum.emzy.de", Server.ConnectionType.SSL, 50002), - new Server("electrum.exan.tech", Server.ConnectionType.SSL, 50002), + new Server("electrum.kcicom.net", Server.ConnectionType.SSL, 50002), new Server("electrum.kendigisland.xyz", Server.ConnectionType.SSL, 50002), - new Server("electrum.mmitech.info", Server.ConnectionType.SSL, 50002), - new Server("electrum.petrkr.net", Server.ConnectionType.SSL, 50002), - new Server("electrum.stippy.com", Server.ConnectionType.SSL, 50002), new Server("electrum.thomasfischbach.de", Server.ConnectionType.SSL, 50002), + new Server("electrum-btc.leblancnet.us", Server.ConnectionType.SSL, 50002), new Server("electrum0.snel.it", Server.ConnectionType.SSL, 50002), - new Server("electrum1.cipig.net", Server.ConnectionType.SSL, 50002), - new Server("electrum2.cipig.net", Server.ConnectionType.SSL, 50002), - new Server("electrum3.cipig.net", Server.ConnectionType.SSL, 50002), - new Server("electrumx.alexridevski.net", Server.ConnectionType.SSL, 50002), + new Server("electrum1.cipig.net", Server.ConnectionType.SSL, 20000), + new Server("electrum2.cipig.net", Server.ConnectionType.SSL, 20000), + new Server("electrum3.cipig.net", Server.ConnectionType.SSL, 20000), + new Server("electrumx.blockfinance-eco.li", Server.ConnectionType.SSL, 50002), + new Server("electrumx.indoor.app", Server.ConnectionType.SSL, 50002), + new Server("electrumx.iodata.org", Server.ConnectionType.SSL, 50002), new Server("electrumx-core.1209k.com", Server.ConnectionType.SSL, 50002), new Server("elx.bitske.com", Server.ConnectionType.SSL, 50002), - new Server("ex03.axalgo.com", Server.ConnectionType.SSL, 50002), - new Server("ex05.axalgo.com", Server.ConnectionType.SSL, 50002), - new Server("ex07.axalgo.com", Server.ConnectionType.SSL, 50002), + new Server("exs.dyshek.org", Server.ConnectionType.SSL, 50002), new Server("fortress.qtornado.com", Server.ConnectionType.SSL, 50002), - new Server("fulcrum.grey.pw", Server.ConnectionType.SSL, 50002), - new Server("fulcrum.sethforprivacy.com", Server.ConnectionType.SSL, 51002), new Server("guichet.centure.cc", Server.ConnectionType.SSL, 50002), + new Server("hodl.artyomk13.me", Server.ConnectionType.SSL, 50002), new Server("hodlers.beer", Server.ConnectionType.SSL, 50002), new Server("kareoke.qoppa.org", Server.ConnectionType.SSL, 50002), new Server("kirsche.emzy.de", Server.ConnectionType.SSL, 50002), + new Server("kittyserver.ddnsfree.com", Server.ConnectionType.SSL, 50002), + new Server("lille.anties.org", Server.ConnectionType.SSL, 50002), + new Server("marseille.anties.org", Server.ConnectionType.SSL, 50002), new Server("node1.btccuracao.com", Server.ConnectionType.SSL, 50002), new Server("osr1ex1.compumundohipermegared.one", Server.ConnectionType.SSL, 50002), - new Server("smmalis37.ddns.net", Server.ConnectionType.SSL, 50002), - new Server("ulrichard.ch", Server.ConnectionType.SSL, 50002), - new Server("vmd104012.contaboserver.net", Server.ConnectionType.SSL, 50002), - new Server("vmd104014.contaboserver.net", Server.ConnectionType.SSL, 50002), + new Server("paris.anties.org", Server.ConnectionType.SSL, 50002), + new Server("ragtor.duckdns.org", Server.ConnectionType.SSL, 50002), + new Server("stavver.dyshek.org", Server.ConnectionType.SSL, 50002), new Server("vmd63185.contaboserver.net", Server.ConnectionType.SSL, 50002), - new Server("vmd71287.contaboserver.net", Server.ConnectionType.SSL, 50002), - new Server("vmd84592.contaboserver.net", Server.ConnectionType.SSL, 50002), new Server("xtrum.com", Server.ConnectionType.SSL, 50002) ); } @@ -135,12 +123,17 @@ public class Bitcoin extends Bitcoiny { @Override public Collection getServers() { return Arrays.asList( - new Server("tn.not.fyi", Server.ConnectionType.SSL, 55002), - new Server("electrumx-test.1209k.com", Server.ConnectionType.SSL, 50002), - new Server("testnet.qtornado.com", Server.ConnectionType.SSL, 51002), - new Server("testnet.aranguren.org", Server.ConnectionType.TCP, 51001), + new Server("bitcoin.devmole.eu", Server.ConnectionType.TCP, 5000), + new Server("bitcoin.stagemole.eu", Server.ConnectionType.TCP, 5000), + new Server("blockstream.info", Server.ConnectionType.SSL, 993), + new Server("electrum.blockstream.info", Server.ConnectionType.SSL, 60002), + new Server("electrum1.cipig.net", Server.ConnectionType.TCP, 10068), + new Server("electrum2.cipig.net", Server.ConnectionType.TCP, 10068), + new Server("electrum3.cipig.net", Server.ConnectionType.TCP, 10068), new Server("testnet.aranguren.org", Server.ConnectionType.SSL, 51002), - new Server("testnet.hsmiths.com", Server.ConnectionType.SSL, 53012) + new Server("testnet.hsmiths.com", Server.ConnectionType.SSL, 53012), + new Server("testnet.qtornado.com", Server.ConnectionType.SSL, 51002), + new Server("v22019051929289916.bestsrv.de", Server.ConnectionType.SSL, 50002) ); } diff --git a/src/main/java/org/qortal/crosschain/Digibyte.java b/src/main/java/org/qortal/crosschain/Digibyte.java index e8e8d7d3..f0a31087 100644 --- a/src/main/java/org/qortal/crosschain/Digibyte.java +++ b/src/main/java/org/qortal/crosschain/Digibyte.java @@ -46,10 +46,6 @@ public class Digibyte extends Bitcoiny { // Servers chosen on NO BASIS WHATSOEVER from various sources! // Status verified at https://1209k.com/bitcoin-eye/ele.php?chain=dgb new Server("electrum.qortal.link", Server.ConnectionType.SSL, 55002), - new Server("electrum1-dgb.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum2-dgb.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum3-dgb.qortal.online", Server.ConnectionType.SSL, 40002), - new Server("electrum4-dgb.qortal.online", Server.ConnectionType.SSL, 40002), new Server("electrum1.cipig.net", Server.ConnectionType.SSL, 20059), new Server("electrum2.cipig.net", Server.ConnectionType.SSL, 20059), new Server("electrum3.cipig.net", Server.ConnectionType.SSL, 20059) diff --git a/src/main/java/org/qortal/crosschain/Dogecoin.java b/src/main/java/org/qortal/crosschain/Dogecoin.java index ca96ef7c..dff98b1c 100644 --- a/src/main/java/org/qortal/crosschain/Dogecoin.java +++ b/src/main/java/org/qortal/crosschain/Dogecoin.java @@ -45,11 +45,8 @@ public class Dogecoin extends Bitcoiny { return Arrays.asList( // Servers chosen on NO BASIS WHATSOEVER from various sources! // Status verified at https://1209k.com/bitcoin-eye/ele.php?chain=doge + new Server("dogecoin.stackwallet.com", Server.ConnectionType.SSL, 50022), new Server("electrum.qortal.link", Server.ConnectionType.SSL, 54002), - new Server("electrum1-doge.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum2-doge.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum3-doge.qortal.online", Server.ConnectionType.SSL, 30002), - new Server("electrum4-doge.qortal.online", Server.ConnectionType.SSL, 30002), new Server("electrum1.cipig.net", Server.ConnectionType.SSL, 20060), new Server("electrum2.cipig.net", Server.ConnectionType.SSL, 20060), new Server("electrum3.cipig.net", Server.ConnectionType.SSL, 20060) diff --git a/src/main/java/org/qortal/crosschain/Litecoin.java b/src/main/java/org/qortal/crosschain/Litecoin.java index 96c13532..f13c1043 100644 --- a/src/main/java/org/qortal/crosschain/Litecoin.java +++ b/src/main/java/org/qortal/crosschain/Litecoin.java @@ -45,13 +45,9 @@ public class Litecoin extends Bitcoiny { return Arrays.asList( // Servers chosen on NO BASIS WHATSOEVER from various sources! // Status verified at https://1209k.com/bitcoin-eye/ele.php?chain=ltc - new Server("electrum.qortal.link", Server.ConnectionType.SSL, 50002), - new Server("electrum1-ltc.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum2-ltc.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum3-ltc.qortal.online", Server.ConnectionType.SSL, 20002), - new Server("electrum4-ltc.qortal.online", Server.ConnectionType.SSL, 20002), new Server("backup.electrum-ltc.org", Server.ConnectionType.SSL, 443), new Server("electrum.ltc.xurious.com", Server.ConnectionType.SSL, 50002), + new Server("electrum.qortal.link", Server.ConnectionType.SSL, 50002), new Server("electrum-ltc.petrkr.net", Server.ConnectionType.SSL, 60002), new Server("electrum1.cipig.net", Server.ConnectionType.SSL, 20063), new Server("electrum2.cipig.net", Server.ConnectionType.SSL, 20063), @@ -79,9 +75,7 @@ public class Litecoin extends Bitcoiny { @Override public Collection getServers() { return Arrays.asList( - new Server("electrum-ltc.bysh.me", Server.ConnectionType.TCP, 51001), new Server("electrum-ltc.bysh.me", Server.ConnectionType.SSL, 51002), - new Server("electrum.ltc.xurious.com", Server.ConnectionType.TCP, 51001), new Server("electrum.ltc.xurious.com", Server.ConnectionType.SSL, 51002) ); } diff --git a/src/main/java/org/qortal/crosschain/PirateChain.java b/src/main/java/org/qortal/crosschain/PirateChain.java index d0f9317d..f4dd79f4 100644 --- a/src/main/java/org/qortal/crosschain/PirateChain.java +++ b/src/main/java/org/qortal/crosschain/PirateChain.java @@ -51,11 +51,6 @@ public class PirateChain extends Bitcoiny { public Collection getServers() { return Arrays.asList( // Servers chosen on NO BASIS WHATSOEVER from various sources! - new Server("wallet-arrr1.qortal.online", Server.ConnectionType.SSL, 443), - new Server("wallet-arrr2.qortal.online", Server.ConnectionType.SSL, 443), - new Server("wallet-arrr3.qortal.online", Server.ConnectionType.SSL, 443), - new Server("wallet-arrr4.qortal.online", Server.ConnectionType.SSL, 443), - new Server("wallet-arrr5.qortal.online", Server.ConnectionType.SSL, 443), new Server("lightd.pirate.black", Server.ConnectionType.SSL, 443) ); } diff --git a/src/main/java/org/qortal/crosschain/Ravencoin.java b/src/main/java/org/qortal/crosschain/Ravencoin.java index b4ed1a13..cd98fb69 100644 --- a/src/main/java/org/qortal/crosschain/Ravencoin.java +++ b/src/main/java/org/qortal/crosschain/Ravencoin.java @@ -46,10 +46,6 @@ public class Ravencoin extends Bitcoiny { // Servers chosen on NO BASIS WHATSOEVER from various sources! // Status verified at https://1209k.com/bitcoin-eye/ele.php?chain=rvn new Server("electrum.qortal.link", Server.ConnectionType.SSL, 56002), - new Server("electrum1-rvn.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum2-rvn.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum3-rvn.qortal.online", Server.ConnectionType.SSL, 50002), - new Server("electrum4-rvn.qortal.online", Server.ConnectionType.SSL, 50002), new Server("electrum1.cipig.net", Server.ConnectionType.SSL, 20051), new Server("electrum2.cipig.net", Server.ConnectionType.SSL, 20051), new Server("electrum3.cipig.net", Server.ConnectionType.SSL, 20051), diff --git a/src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabaseUpdates.java b/src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabaseUpdates.java index 829f7aab..54af22e9 100644 --- a/src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabaseUpdates.java +++ b/src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabaseUpdates.java @@ -1047,6 +1047,11 @@ public class HSQLDBDatabaseUpdates { stmt.execute("CREATE INDEX ArbitraryIdentifierIndex ON ArbitraryTransactions (identifier)"); break; + case 49: + // Update blocks minted penalty + stmt.execute("UPDATE Accounts SET blocks_minted_penalty = -5000000 WHERE blocks_minted_penalty < 0"); + break; + default: // nothing to do return false; diff --git a/src/main/java/org/qortal/settings/Settings.java b/src/main/java/org/qortal/settings/Settings.java index 533e1639..3ca86cc0 100644 --- a/src/main/java/org/qortal/settings/Settings.java +++ b/src/main/java/org/qortal/settings/Settings.java @@ -211,7 +211,7 @@ public class Settings { public long recoveryModeTimeout = 9999999999999L; /** Minimum peer version number required in order to sync with them */ - private String minPeerVersion = "4.4.1"; + private String minPeerVersion = "4.4.2"; /** Whether to allow connections with peers below minPeerVersion * If true, we won't sync with them but they can still sync with us, and will show in the peers list * If false, sync will be blocked both ways, and they will not appear in the peers list */ @@ -272,8 +272,7 @@ public class Settings { private String[] bootstrapHosts = new String[] { "http://bootstrap.qortal.org", "http://bootstrap2.qortal.org", - "http://bootstrap3.qortal.org", - "http://bootstrap.qortal.online" + "http://bootstrap3.qortal.org" }; // Auto-update sources diff --git a/src/main/java/org/qortal/transaction/Transaction.java b/src/main/java/org/qortal/transaction/Transaction.java index 0b4f6e90..c142fff8 100644 --- a/src/main/java/org/qortal/transaction/Transaction.java +++ b/src/main/java/org/qortal/transaction/Transaction.java @@ -246,6 +246,7 @@ public abstract class Transaction { NAME_BLOCKED(97), GROUP_APPROVAL_REQUIRED(98), ACCOUNT_NOT_TRANSFERABLE(99), + TRANSFER_PRIVS_DISABLED(100), INVALID_BUT_OK(999), NOT_YET_RELEASED(1000), NOT_SUPPORTED(1001); diff --git a/src/main/java/org/qortal/transaction/TransferPrivsTransaction.java b/src/main/java/org/qortal/transaction/TransferPrivsTransaction.java index de3038d8..588f0d09 100644 --- a/src/main/java/org/qortal/transaction/TransferPrivsTransaction.java +++ b/src/main/java/org/qortal/transaction/TransferPrivsTransaction.java @@ -4,6 +4,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.qortal.account.Account; import org.qortal.asset.Asset; +import org.qortal.block.Block; import org.qortal.block.BlockChain; import org.qortal.crypto.Crypto; import org.qortal.data.account.AccountData; @@ -72,6 +73,13 @@ public class TransferPrivsTransaction extends Transaction { if (senderAccountData == null || senderAccountData.getBlocksMintedPenalty() != 0) return ValidationResult.ACCOUNT_NOT_TRANSFERABLE; + // Disable Transfer Privs (start - end) from feature trigger + long transactionTimestamp = this.transferPrivsTransactionData.getTimestamp(); + final long startTimestamp = BlockChain.getInstance().getDisableTransferPrivsTimestamp(); + final long endTimestamp = BlockChain.getInstance().getEnableTransferPrivsTimestamp(); + if (transactionTimestamp > startTimestamp && transactionTimestamp < endTimestamp) + return ValidationResult.TRANSFER_PRIVS_DISABLED; + return ValidationResult.OK; } @@ -80,6 +88,17 @@ public class TransferPrivsTransaction extends Transaction { // Nothing to do } + @Override + public boolean isConfirmableAtHeight(int height) { + if (height >= BlockChain.getInstance().getUnconfirmableRewardSharesHeight()) { + // Not confirmable in online accounts or distribution blocks + if (Block.isOnlineAccountsBlock(height) || Block.isBatchRewardDistributionBlock(height)) { + return false; + } + } + return true; + } + @Override public void process() throws DataException { Account sender = this.getSender(); diff --git a/src/main/resources/blockchain.json b/src/main/resources/blockchain.json index 8631fbf4..ff3d1c37 100644 --- a/src/main/resources/blockchain.json +++ b/src/main/resources/blockchain.json @@ -30,6 +30,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 1659801600000, "selfSponsorshipAlgoV1SnapshotTimestamp": 1670230000000, + "selfSponsorshipAlgoV2SnapshotTimestamp": 1706745600000, "mempowTransactionUpdatesTimestamp": 1693558800000, "blockRewardBatchStartHeight": 1508000, "blockRewardBatchSize": 1000, @@ -93,10 +94,13 @@ "increaseOnlineAccountsDifficultyTimestamp": 9999999999999, "onlineAccountMinterLevelValidationHeight": 1092000, "selfSponsorshipAlgoV1Height": 1092400, + "selfSponsorshipAlgoV2Height": 9999999, "feeValidationFixTimestamp": 1671918000000, "chatReferenceTimestamp": 1674316800000, "arbitraryOptionalFeeTimestamp": 1680278400000, - "unconfirmableRewardSharesHeight": 1575500 + "unconfirmableRewardSharesHeight": 1575500, + "disableTransferPrivsTimestamp": 1706745000000, + "enableTransferPrivsTimestamp": 1709251200000 }, "checkpoints": [ { "height": 1136300, "signature": "3BbwawEF2uN8Ni5ofpJXkukoU8ctAPxYoFB7whq9pKfBnjfZcpfEJT4R95NvBDoTP8WDyWvsUvbfHbcr9qSZuYpSKZjUQTvdFf6eqznHGEwhZApWfvXu6zjGCxYCp65F4jsVYYJjkzbjmkCg5WAwN5voudngA23kMK6PpTNygapCzXt" } diff --git a/src/main/resources/i18n/TransactionValidity_de.properties b/src/main/resources/i18n/TransactionValidity_de.properties index eab7fb9e..bdb88a29 100644 --- a/src/main/resources/i18n/TransactionValidity_de.properties +++ b/src/main/resources/i18n/TransactionValidity_de.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = Transaktion existiert bereits TRANSACTION_UNKNOWN = Transaktion unbekannt TX_GROUP_ID_MISMATCH = die Gruppen-ID der Transaktion stimmt nicht überein + +TRANSFER_PRIVS_DISABLED = Übertragungsberechtigungen deaktiviert diff --git a/src/main/resources/i18n/TransactionValidity_en.properties b/src/main/resources/i18n/TransactionValidity_en.properties index 3f33771d..0bfeeef2 100644 --- a/src/main/resources/i18n/TransactionValidity_en.properties +++ b/src/main/resources/i18n/TransactionValidity_en.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = transaction already exists TRANSACTION_UNKNOWN = transaction unknown TX_GROUP_ID_MISMATCH = transaction's group ID does not match + +TRANSFER_PRIVS_DISABLED = transfer privileges disabled diff --git a/src/main/resources/i18n/TransactionValidity_es.properties b/src/main/resources/i18n/TransactionValidity_es.properties index 7c357009..b3e981ae 100644 --- a/src/main/resources/i18n/TransactionValidity_es.properties +++ b/src/main/resources/i18n/TransactionValidity_es.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = la transacción ya existe TRANSACTION_UNKNOWN = transacción desconocida TX_GROUP_ID_MISMATCH = el ID de grupo de la transacción no coincide + +TRANSFER_PRIVS_DISABLED = privilegios de transferencia deshabilitados diff --git a/src/main/resources/i18n/TransactionValidity_fi.properties b/src/main/resources/i18n/TransactionValidity_fi.properties index ec658bc1..1a9b9f31 100644 --- a/src/main/resources/i18n/TransactionValidity_fi.properties +++ b/src/main/resources/i18n/TransactionValidity_fi.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = transaktio on jo olemassa TRANSACTION_UNKNOWN = tuntematon transaktio TX_GROUP_ID_MISMATCH = transaktion ryhmä-ID:n vastaavuusvirhe + +TRANSFER_PRIVS_DISABLED = siirtooikeudet poistettu käytöstä diff --git a/src/main/resources/i18n/TransactionValidity_fr.properties b/src/main/resources/i18n/TransactionValidity_fr.properties index e030bc0d..75fcf369 100644 --- a/src/main/resources/i18n/TransactionValidity_fr.properties +++ b/src/main/resources/i18n/TransactionValidity_fr.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = la transaction existe déjà TRANSACTION_UNKNOWN = transaction inconnue TX_GROUP_ID_MISMATCH = l'identifiant du groupe de transaction ne correspond pas + +TRANSFER_PRIVS_DISABLED = privilèges de transfert désactivés diff --git a/src/main/resources/i18n/TransactionValidity_he.properties b/src/main/resources/i18n/TransactionValidity_he.properties index 889d7b78..427f01e3 100644 --- a/src/main/resources/i18n/TransactionValidity_he.properties +++ b/src/main/resources/i18n/TransactionValidity_he.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = עסקה כבר קיימת TRANSACTION_UNKNOWN = עסקה לא ידועה TX_GROUP_ID_MISMATCH = מזהה הקבוצה של העסקה אינו תואם + +TRANSFER_PRIVS_DISABLED = הרשאות העברה מושבתות diff --git a/src/main/resources/i18n/TransactionValidity_hu.properties b/src/main/resources/i18n/TransactionValidity_hu.properties index 1b2558bb..77e7dcff 100644 --- a/src/main/resources/i18n/TransactionValidity_hu.properties +++ b/src/main/resources/i18n/TransactionValidity_hu.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = ez a tranzakció már létezik TRANSACTION_UNKNOWN = ismeretlen tranzakció TX_GROUP_ID_MISMATCH = a tranzakció csoportazonosítója nem egyezik + +TRANSFER_PRIVS_DISABLED = átviteli jogosultságok letiltva diff --git a/src/main/resources/i18n/TransactionValidity_it.properties b/src/main/resources/i18n/TransactionValidity_it.properties index 390f914a..02a13667 100644 --- a/src/main/resources/i18n/TransactionValidity_it.properties +++ b/src/main/resources/i18n/TransactionValidity_it.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = la transazione già esiste TRANSACTION_UNKNOWN = transazione sconosciuta TX_GROUP_ID_MISMATCH = identificazione di gruppo della transazione non corrisponde + +TRANSFER_PRIVS_DISABLED = privilegi di trasferimento disabilitati diff --git a/src/main/resources/i18n/TransactionValidity_jp.properties b/src/main/resources/i18n/TransactionValidity_jp.properties index 9540372a..10fa273c 100644 --- a/src/main/resources/i18n/TransactionValidity_jp.properties +++ b/src/main/resources/i18n/TransactionValidity_jp.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = 既にトランザクションは存在します TRANSACTION_UNKNOWN = 不明なトランザクション TX_GROUP_ID_MISMATCH = トランザクションのグループIDが一致しません + +TRANSFER_PRIVS_DISABLED = 転送権限が無効になっています diff --git a/src/main/resources/i18n/TransactionValidity_ko.properties b/src/main/resources/i18n/TransactionValidity_ko.properties index a12b33f6..cbab9190 100644 --- a/src/main/resources/i18n/TransactionValidity_ko.properties +++ b/src/main/resources/i18n/TransactionValidity_ko.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = 거래가 이미 존재합니다 TRANSACTION_UNKNOWN = 알 수 없는 거래 TX_GROUP_ID_MISMATCH = 트랜잭션의 그룹 ID가 일치하지 않습니다 + +TRANSFER_PRIVS_DISABLED = 권한 이전이 비활성화되었습니다. diff --git a/src/main/resources/i18n/TransactionValidity_nl.properties b/src/main/resources/i18n/TransactionValidity_nl.properties index f92adf72..933d6166 100644 --- a/src/main/resources/i18n/TransactionValidity_nl.properties +++ b/src/main/resources/i18n/TransactionValidity_nl.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = transactie bestaat reeds TRANSACTION_UNKNOWN = transactie onbekend TX_GROUP_ID_MISMATCH = groep-ID komt niet overeen + +TRANSFER_PRIVS_DISABLED = overdrachtsrechten uitgeschakeld diff --git a/src/main/resources/i18n/TransactionValidity_pl.properties b/src/main/resources/i18n/TransactionValidity_pl.properties index bcdceb6e..80cb4b12 100644 --- a/src/main/resources/i18n/TransactionValidity_pl.properties +++ b/src/main/resources/i18n/TransactionValidity_pl.properties @@ -194,3 +194,4 @@ TRANSACTION_UNKNOWN = transakcja nieznana TX_GROUP_ID_MISMATCH = niezgodność ID grupy transakcji +TRANSFER_PRIVS_DISABLED = uprawnienia do przenoszenia wyłączone diff --git a/src/main/resources/i18n/TransactionValidity_ro.properties b/src/main/resources/i18n/TransactionValidity_ro.properties index 6c67f31b..be0d8596 100644 --- a/src/main/resources/i18n/TransactionValidity_ro.properties +++ b/src/main/resources/i18n/TransactionValidity_ro.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = tranzactia exista deja TRANSACTION_UNKNOWN = tranzactie necunoscuta TX_GROUP_ID_MISMATCH = ID-ul de grup al tranzactiei nu se potriveste + +TRANSFER_PRIVS_DISABLED = privilegii de transfer dezactivate diff --git a/src/main/resources/i18n/TransactionValidity_ru.properties b/src/main/resources/i18n/TransactionValidity_ru.properties index 2818374a..55b19487 100644 --- a/src/main/resources/i18n/TransactionValidity_ru.properties +++ b/src/main/resources/i18n/TransactionValidity_ru.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = транзакция существует TRANSACTION_UNKNOWN = неизвестная транзакция TX_GROUP_ID_MISMATCH = не соответствие идентификатора группы в хэш транзации + +TRANSFER_PRIVS_DISABLED = права на передачу отключены diff --git a/src/main/resources/i18n/TransactionValidity_sv.properties b/src/main/resources/i18n/TransactionValidity_sv.properties index a3fec831..2f6f85d9 100644 --- a/src/main/resources/i18n/TransactionValidity_sv.properties +++ b/src/main/resources/i18n/TransactionValidity_sv.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = transaktionen finns redan TRANSACTION_UNKNOWN = okänd transaktion TX_GROUP_ID_MISMATCH = transaktionens grupp-ID matchar inte + +TRANSFER_PRIVS_DISABLED = överföringsprivilegier inaktiverade diff --git a/src/main/resources/i18n/TransactionValidity_zh_CN.properties b/src/main/resources/i18n/TransactionValidity_zh_CN.properties index d2a2ec7c..ce35b7b3 100644 --- a/src/main/resources/i18n/TransactionValidity_zh_CN.properties +++ b/src/main/resources/i18n/TransactionValidity_zh_CN.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = 此交易已存在 TRANSACTION_UNKNOWN = 未知的交易 TX_GROUP_ID_MISMATCH = 群组ID交易不吻合 + +TRANSFER_PRIVS_DISABLED = 传输权限已禁用 diff --git a/src/main/resources/i18n/TransactionValidity_zh_TW.properties b/src/main/resources/i18n/TransactionValidity_zh_TW.properties index e88addb9..13c1210e 100644 --- a/src/main/resources/i18n/TransactionValidity_zh_TW.properties +++ b/src/main/resources/i18n/TransactionValidity_zh_TW.properties @@ -193,3 +193,5 @@ TRANSACTION_ALREADY_EXISTS = 此交易已存在 TRANSACTION_UNKNOWN = 未知的交易 TX_GROUP_ID_MISMATCH = 群組ID交易不吻合 + +TRANSFER_PRIVS_DISABLED = 傳輸權限已停用 diff --git a/src/test/java/org/qortal/test/PenaltyFixTests.java b/src/test/java/org/qortal/test/PenaltyFixTests.java new file mode 100644 index 00000000..6d06f5f1 --- /dev/null +++ b/src/test/java/org/qortal/test/PenaltyFixTests.java @@ -0,0 +1,82 @@ +package org.qortal.test; + +import org.junit.Before; +import org.junit.Test; +import org.qortal.account.Account; +import org.qortal.account.PrivateKeyAccount; +import org.qortal.block.Block; +import org.qortal.controller.BlockMinter; +import org.qortal.data.transaction.PaymentTransactionData; +import org.qortal.data.transaction.TransactionData; +import org.qortal.repository.DataException; +import org.qortal.repository.Repository; +import org.qortal.repository.RepositoryManager; +import org.qortal.settings.Settings; +import org.qortal.test.common.BlockUtils; +import org.qortal.test.common.Common; +import org.qortal.test.common.TransactionUtils; +import org.qortal.test.common.transaction.TestTransaction; +import org.qortal.utils.NTP; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +public class PenaltyFixTests extends Common { + + @Before + public void beforeTest() throws DataException { + Common.useSettings("test-settings-v2-penalty-fix.json"); + NTP.setFixedOffset(Settings.getInstance().getTestNtpOffset()); + } + + @Test + public void testSingleSponsor() throws DataException { + try (final Repository repository = RepositoryManager.getRepository()) { + + // Alice self share online, and will be used to mint the blocks + PrivateKeyAccount aliceSelfShare = Common.getTestAccount(repository, "alice-reward-share"); + List onlineAccounts = new ArrayList<>(); + onlineAccounts.add(aliceSelfShare); + + PrivateKeyAccount bobAccount = Common.getTestAccount(repository, "bob"); + + // Test account from real penalty data (pen-revert.json) + Account penaltyAccount = new Account(repository, "QLcAQpko5egwNjifueCAeAsT8CAj2Sr5qJ"); + + // Bob sends a payment to the penalty account, so that it gets a row in the Accounts table + TransactionData paymentData = new PaymentTransactionData(TestTransaction.generateBase(bobAccount), penaltyAccount.getAddress(), 1); + TransactionUtils.signAndImportValid(repository, paymentData, bobAccount); // updates paymentData's signature + + // Mint blocks up to height 4 + Block block = null; + for (int i = 2; i <= 4; i++) + block = BlockMinter.mintTestingBlock(repository, onlineAccounts.toArray(new PrivateKeyAccount[0])); + + assertEquals(4, (int)block.getBlockData().getHeight()); + + // Check blocks minted penalty of penalty account + assertEquals(0, (int) penaltyAccount.getBlocksMintedPenalty()); + + // Penalty revert code runs at block 5 + block = BlockMinter.mintTestingBlock(repository, onlineAccounts.toArray(new PrivateKeyAccount[0])); + assertEquals(5, (int)block.getBlockData().getHeight()); + + // +5000000 blocks minted penalty should be applied + assertEquals(5000000, (int) penaltyAccount.getBlocksMintedPenalty()); + + // Orphan the last block, to simulate a re-org + BlockUtils.orphanLastBlock(repository); + + assertEquals(0, (int) penaltyAccount.getBlocksMintedPenalty()); + + // Penalty revert code runs again + block = BlockMinter.mintTestingBlock(repository, onlineAccounts.toArray(new PrivateKeyAccount[0])); + assertEquals(5, (int)block.getBlockData().getHeight()); + + // Penalty should still be 5000000, rather than doubled up to 10000000 + assertEquals(5000000, (int) penaltyAccount.getBlocksMintedPenalty()); + } + } +} \ No newline at end of file diff --git a/src/test/java/org/qortal/test/SelfSponsorshipAlgoV1Tests.java b/src/test/java/org/qortal/test/SelfSponsorshipAlgoV1Tests.java index 5c038de2..fe0556ca 100644 --- a/src/test/java/org/qortal/test/SelfSponsorshipAlgoV1Tests.java +++ b/src/test/java/org/qortal/test/SelfSponsorshipAlgoV1Tests.java @@ -38,7 +38,7 @@ public class SelfSponsorshipAlgoV1Tests extends Common { @Before public void beforeTest() throws DataException { - Common.useSettings("test-settings-v2-self-sponsorship-algo.json"); + Common.useSettings("test-settings-v2-self-sponsorship-algo-v1.json"); NTP.setFixedOffset(Settings.getInstance().getTestNtpOffset()); } diff --git a/src/test/java/org/qortal/test/crosschain/BitcoinTests.java b/src/test/java/org/qortal/test/crosschain/BitcoinTests.java index e83afac2..8c41d2d2 100644 --- a/src/test/java/org/qortal/test/crosschain/BitcoinTests.java +++ b/src/test/java/org/qortal/test/crosschain/BitcoinTests.java @@ -41,24 +41,4 @@ public class BitcoinTests extends BitcoinyTests { protected String getRecipient() { return "2N8WCg52ULCtDSMjkgVTm5mtPdCsUptkHWE"; } - - @Test - @Ignore("Often fails due to unreliable BTC testnet ElectrumX servers") - public void testGetMedianBlockTime() {} - - @Test - @Ignore("Often fails due to unreliable BTC testnet ElectrumX servers") - public void testFindHtlcSecret() {} - - @Test - @Ignore("Often fails due to unreliable BTC testnet ElectrumX servers") - public void testBuildSpend() {} - - @Test - @Ignore("Often fails due to unreliable BTC testnet ElectrumX servers") - public void testGetWalletBalance() {} - - @Test - @Ignore("Often fails due to unreliable BTC testnet ElectrumX servers") - public void testGetUnusedReceiveAddress() {} } diff --git a/src/test/java/org/qortal/test/crosschain/DigibyteTests.java b/src/test/java/org/qortal/test/crosschain/DigibyteTests.java index 9e932bbf..5387539e 100644 --- a/src/test/java/org/qortal/test/crosschain/DigibyteTests.java +++ b/src/test/java/org/qortal/test/crosschain/DigibyteTests.java @@ -29,17 +29,17 @@ public class DigibyteTests extends BitcoinyTests { @Override protected String getDeterministicKey58() { - return "xpub661MyMwAqRbcEnabTLX5uebYcsE3uG5y7ve9jn1VK8iY1MaU3YLoLJEe8sTu2YVav5Zka5qf2dmMssfxmXJTqZnazZL2kL7M2tNKwEoC34R"; + return "xprv9z8QpS7vxwMC2fCnG1oZc6c4aFRLgsqSF86yWrJBKEzMY3T3ySCo85x8Uv5FxTavAQwgEDy1g3iLRT5kdtFjoNNBKukLTMzKwCUn1Abwoxg"; } @Override protected String getDeterministicPublicKey58() { - return "xpub661MyMwAqRbcEnabTLX5uebYcsE3uG5y7ve9jn1VK8iY1MaU3YLoLJEe8sTu2YVav5Zka5qf2dmMssfxmXJTqZnazZL2kL7M2tNKwEoC34R"; + return "xpub6D7mDwepoJuVF9HFN3LZyEYo8HFq6LZHcM2aKEhnsaXLQqnCWyX3ftGcLDcjYmiPCc9GNX4VjfT32hwvYQnh9H5Z5diAvMsXRrxFmckyNoR"; } @Override protected String getRecipient() { - return "2N8WCg52ULCtDSMjkgVTm5mtPdCsUptkHWE"; + return null; } @Test diff --git a/src/test/java/org/qortal/test/crosschain/PirateChainTests.java b/src/test/java/org/qortal/test/crosschain/PirateChainTests.java index a2c2a9ec..01b9449b 100644 --- a/src/test/java/org/qortal/test/crosschain/PirateChainTests.java +++ b/src/test/java/org/qortal/test/crosschain/PirateChainTests.java @@ -259,4 +259,8 @@ public class PirateChainTests extends BitcoinyTests { @Test @Ignore(value = "Needs adapting for Pirate Chain") public void testWalletSpendingCandidateAddresses() throws ForeignBlockchainException {} + + @Test + @Ignore(value = "Needs adapting for Pirate Chain") + public void testRepair() throws ForeignBlockchainException {} } \ No newline at end of file diff --git a/src/test/java/org/qortal/test/crosschain/RavencoinTests.java b/src/test/java/org/qortal/test/crosschain/RavencoinTests.java index 3d590199..f9e6f4ae 100644 --- a/src/test/java/org/qortal/test/crosschain/RavencoinTests.java +++ b/src/test/java/org/qortal/test/crosschain/RavencoinTests.java @@ -29,12 +29,12 @@ public class RavencoinTests extends BitcoinyTests { @Override protected String getDeterministicKey58() { - return "xpub661MyMwAqRbcEt3Ge1wNmkagyb1J7yTQu4Kquvy77Ycg2iPoh7Urg8s9Jdwp7YmrqGkDKJpUVjsZXSSsQgmAVUC17ZVQQeoWMzm7vDTt1y7"; + return "xprv9z8QpS7vxwMC2fCnG1oZc6c4aFRLgsqSF86yWrJBKEzMY3T3ySCo85x8Uv5FxTavAQwgEDy1g3iLRT5kdtFjoNNBKukLTMzKwCUn1Abwoxg"; } @Override protected String getDeterministicPublicKey58() { - return "xpub661MyMwAqRbcEt3Ge1wNmkagyb1J7yTQu4Kquvy77Ycg2iPoh7Urg8s9Jdwp7YmrqGkDKJpUVjsZXSSsQgmAVUC17ZVQQeoWMzm7vDTt1y7"; + return "xpub6D7mDwepoJuVF9HFN3LZyEYo8HFq6LZHcM2aKEhnsaXLQqnCWyX3ftGcLDcjYmiPCc9GNX4VjfT32hwvYQnh9H5Z5diAvMsXRrxFmckyNoR"; } @Override diff --git a/src/test/resources/test-chain-v2-block-timestamps.json b/src/test/resources/test-chain-v2-block-timestamps.json index e5460bec..8f863ada 100644 --- a/src/test/resources/test-chain-v2-block-timestamps.json +++ b/src/test/resources/test-chain-v2-block-timestamps.json @@ -18,6 +18,7 @@ "onlineAccountSignaturesMinLifetime": 3600000, "onlineAccountSignaturesMaxLifetime": 86400000, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -84,7 +85,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-disable-reference.json b/src/test/resources/test-chain-v2-disable-reference.json index 3d76620a..f5938c01 100644 --- a/src/test/resources/test-chain-v2-disable-reference.json +++ b/src/test/resources/test-chain-v2-disable-reference.json @@ -22,6 +22,7 @@ "onlineAccountSignaturesMinLifetime": 3600000, "onlineAccountSignaturesMaxLifetime": 86400000, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -87,7 +88,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-founder-rewards.json b/src/test/resources/test-chain-v2-founder-rewards.json index e778f792..9fda74f5 100644 --- a/src/test/resources/test-chain-v2-founder-rewards.json +++ b/src/test/resources/test-chain-v2-founder-rewards.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-leftover-reward.json b/src/test/resources/test-chain-v2-leftover-reward.json index ec64f5a9..20a85b8a 100644 --- a/src/test/resources/test-chain-v2-leftover-reward.json +++ b/src/test/resources/test-chain-v2-leftover-reward.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-minting.json b/src/test/resources/test-chain-v2-minting.json index 72051c29..7c28435a 100644 --- a/src/test/resources/test-chain-v2-minting.json +++ b/src/test/resources/test-chain-v2-minting.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 9999999999999, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 9999999999999, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-penalty-fix.json b/src/test/resources/test-chain-v2-penalty-fix.json new file mode 100644 index 00000000..e62fc9f2 --- /dev/null +++ b/src/test/resources/test-chain-v2-penalty-fix.json @@ -0,0 +1,130 @@ +{ + "isTestChain": true, + "blockTimestampMargin": 500, + "transactionExpiryPeriod": 86400000, + "maxBlockSize": 2097152, + "maxBytesPerUnitFee": 0, + "unitFees": [ + { "timestamp": 0, "fee": "0.00000001" } + ], + "nameRegistrationUnitFees": [ + { "timestamp": 0, "fee": "0.00000001" }, + { "timestamp": 1645372800000, "fee": "5" } + ], + "requireGroupForApproval": false, + "minAccountLevelToRewardShare": 5, + "maxRewardSharesPerFounderMintingAccount": 20, + "maxRewardSharesByTimestamp": [ + { "timestamp": 0, "maxShares": 20 }, + { "timestamp": 9999999999999, "maxShares": 3 } + ], + "founderEffectiveMintingLevel": 10, + "onlineAccountSignaturesMinLifetime": 3600000, + "onlineAccountSignaturesMaxLifetime": 86400000, + "onlineAccountsModulusV2Timestamp": 9999999999999, + "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, + "mempowTransactionUpdatesTimestamp": 0, + "blockRewardBatchStartHeight": 999999000, + "blockRewardBatchSize": 10, + "blockRewardBatchAccountsBlockCount": 3, + "rewardsByHeight": [ + { "height": 1, "reward": 100 }, + { "height": 11, "reward": 10 }, + { "height": 21, "reward": 1 } + ], + "sharesByLevelV1": [ + { "id": 1, "levels": [ 1, 2 ], "share": 0.05 }, + { "id": 2, "levels": [ 3, 4 ], "share": 0.10 }, + { "id": 3, "levels": [ 5, 6 ], "share": 0.15 }, + { "id": 4, "levels": [ 7, 8 ], "share": 0.20 }, + { "id": 5, "levels": [ 9, 10 ], "share": 0.25 } + ], + "sharesByLevelV2": [ + { "id": 1, "levels": [ 1, 2 ], "share": 0.06 }, + { "id": 2, "levels": [ 3, 4 ], "share": 0.13 }, + { "id": 3, "levels": [ 5, 6 ], "share": 0.19 }, + { "id": 4, "levels": [ 7, 8 ], "share": 0.26 }, + { "id": 5, "levels": [ 9, 10 ], "share": 0.32 } + ], + "qoraHoldersShareByHeight": [ + { "height": 1, "share": 0.20 }, + { "height": 1000000, "share": 0.01 } + ], + "qoraPerQortReward": 250, + "minAccountsToActivateShareBin": 0, + "shareBinActivationMinLevel": 7, + "blocksNeededByLevel": [ 5, 20, 30, 40, 50, 60, 18, 80, 90, 100 ], + "blockTimingsByHeight": [ + { "height": 1, "target": 60000, "deviation": 30000, "power": 0.2 } + ], + "ciyamAtSettings": { + "feePerStep": "0.0001", + "maxStepsPerRound": 500, + "stepsPerFunctionCall": 10, + "minutesPerBlock": 1 + }, + "featureTriggers": { + "messageHeight": 0, + "atHeight": 0, + "assetsTimestamp": 0, + "votingTimestamp": 0, + "arbitraryTimestamp": 0, + "powfixTimestamp": 0, + "qortalTimestamp": 0, + "newAssetPricingTimestamp": 0, + "groupApprovalTimestamp": 0, + "atFindNextTransactionFix": 0, + "newBlockSigHeight": 999999, + "shareBinFix": 999999, + "sharesByLevelV2Height": 999999, + "rewardShareLimitTimestamp": 9999999999999, + "calcChainWeightTimestamp": 0, + "transactionV5Timestamp": 0, + "transactionV6Timestamp": 0, + "disableReferenceTimestamp": 9999999999999, + "increaseOnlineAccountsDifficultyTimestamp": 9999999999999, + "onlineAccountMinterLevelValidationHeight": 0, + "selfSponsorshipAlgoV1Height": 99999999, + "feeValidationFixTimestamp": 0, + "chatReferenceTimestamp": 0, + "arbitraryOptionalFeeTimestamp": 0, + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 5 + }, + "genesisInfo": { + "version": 4, + "timestamp": 0, + "transactions": [ + { "type": "ISSUE_ASSET", "assetName": "QORT", "description": "QORT native coin", "data": "", "quantity": 0, "isDivisible": true, "fee": 0 }, + { "type": "ISSUE_ASSET", "assetName": "Legacy-QORA", "description": "Representative legacy QORA", "quantity": 0, "isDivisible": true, "data": "{}", "isUnspendable": true }, + { "type": "ISSUE_ASSET", "assetName": "QORT-from-QORA", "description": "QORT gained from holding legacy QORA", "quantity": 0, "isDivisible": true, "data": "{}", "isUnspendable": true }, + + { "type": "GENESIS", "recipient": "QgV4s3xnzLhVBEJxcYui4u4q11yhUHsd9v", "amount": "1000000000" }, + { "type": "GENESIS", "recipient": "QixPbJUwsaHsVEofJdozU9zgVqkK6aYhrK", "amount": "1000000" }, + { "type": "GENESIS", "recipient": "QaUpHNhT3Ygx6avRiKobuLdusppR5biXjL", "amount": "1000000" }, + { "type": "GENESIS", "recipient": "Qci5m9k4rcwe4ruKrZZQKka4FzUUMut3er", "amount": "1000000" }, + + { "type": "CREATE_GROUP", "creatorPublicKey": "2tiMr5LTpaWCgbRvkPK8TFd7k63DyHJMMFFsz9uBf1ZP", "groupName": "dev-group", "description": "developer group", "isOpen": false, "approvalThreshold": "PCT100", "minimumBlockDelay": 0, "maximumBlockDelay": 1440 }, + + { "type": "UPDATE_GROUP", "ownerPublicKey": "2tiMr5LTpaWCgbRvkPK8TFd7k63DyHJMMFFsz9uBf1ZP", "groupId": 1, "newOwner": "QdSnUy6sUiEnaN87dWmE92g1uQjrvPgrWG", "newDescription": "developer group", "newIsOpen": false, "newApprovalThreshold": "PCT40", "minimumBlockDelay": 10, "maximumBlockDelay": 1440 }, + + { "type": "ISSUE_ASSET", "issuerPublicKey": "2tiMr5LTpaWCgbRvkPK8TFd7k63DyHJMMFFsz9uBf1ZP", "assetName": "TEST", "description": "test asset", "data": "", "quantity": "1000000", "isDivisible": true, "fee": 0 }, + { "type": "ISSUE_ASSET", "issuerPublicKey": "C6wuddsBV3HzRrXUtezE7P5MoRXp5m3mEDokRDGZB6ry", "assetName": "OTHER", "description": "other test asset", "data": "", "quantity": "1000000", "isDivisible": true, "fee": 0 }, + { "type": "ISSUE_ASSET", "issuerPublicKey": "2tiMr5LTpaWCgbRvkPK8TFd7k63DyHJMMFFsz9uBf1ZP", "assetName": "GOLD", "description": "gold test asset", "data": "", "quantity": "1000000", "isDivisible": true, "fee": 0 }, + + { "type": "ACCOUNT_FLAGS", "target": "QgV4s3xnzLhVBEJxcYui4u4q11yhUHsd9v", "andMask": -1, "orMask": 1, "xorMask": 0 }, + { "type": "REWARD_SHARE", "minterPublicKey": "2tiMr5LTpaWCgbRvkPK8TFd7k63DyHJMMFFsz9uBf1ZP", "recipient": "QgV4s3xnzLhVBEJxcYui4u4q11yhUHsd9v", "rewardSharePublicKey": "7PpfnvLSG7y4HPh8hE7KoqAjLCkv7Ui6xw4mKAkbZtox", "sharePercent": "100" }, + + { "type": "ACCOUNT_LEVEL", "target": "QixPbJUwsaHsVEofJdozU9zgVqkK6aYhrK", "level": 5 }, + { "type": "REWARD_SHARE", "minterPublicKey": "C6wuddsBV3HzRrXUtezE7P5MoRXp5m3mEDokRDGZB6ry", "recipient": "QixPbJUwsaHsVEofJdozU9zgVqkK6aYhrK", "rewardSharePublicKey": "CcABzvk26TFEHG7Yok84jxyd4oBtLkx8RJdGFVz2csvp", "sharePercent": 100 }, + + { "type": "ACCOUNT_LEVEL", "target": "Qci5m9k4rcwe4ruKrZZQKka4FzUUMut3er", "level": 5 }, + { "type": "ACCOUNT_LEVEL", "target": "QaUpHNhT3Ygx6avRiKobuLdusppR5biXjL", "level": 5 }, + { "type": "ACCOUNT_LEVEL", "target": "Qci5m9k4rcwe4ruKrZZQKka4FzUUMut3er", "level": 6 } + ] + } +} diff --git a/src/test/resources/test-chain-v2-qora-holder-extremes.json b/src/test/resources/test-chain-v2-qora-holder-extremes.json index 4b8d4b80..0372ba4f 100644 --- a/src/test/resources/test-chain-v2-qora-holder-extremes.json +++ b/src/test/resources/test-chain-v2-qora-holder-extremes.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-qora-holder-reduction.json b/src/test/resources/test-chain-v2-qora-holder-reduction.json index 5484745b..9fbeb317 100644 --- a/src/test/resources/test-chain-v2-qora-holder-reduction.json +++ b/src/test/resources/test-chain-v2-qora-holder-reduction.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -89,7 +90,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-qora-holder.json b/src/test/resources/test-chain-v2-qora-holder.json index 50b4910a..e9a2b485 100644 --- a/src/test/resources/test-chain-v2-qora-holder.json +++ b/src/test/resources/test-chain-v2-qora-holder.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-reward-levels.json b/src/test/resources/test-chain-v2-reward-levels.json index 99c98e2f..b4993aee 100644 --- a/src/test/resources/test-chain-v2-reward-levels.json +++ b/src/test/resources/test-chain-v2-reward-levels.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-reward-scaling.json b/src/test/resources/test-chain-v2-reward-scaling.json index 1c59476a..4c3595bf 100644 --- a/src/test/resources/test-chain-v2-reward-scaling.json +++ b/src/test/resources/test-chain-v2-reward-scaling.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 500 + "unconfirmableRewardSharesHeight": 500, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-reward-shares.json b/src/test/resources/test-chain-v2-reward-shares.json index fd63add0..243a3ead 100644 --- a/src/test/resources/test-chain-v2-reward-shares.json +++ b/src/test/resources/test-chain-v2-reward-shares.json @@ -22,6 +22,7 @@ "onlineAccountSignaturesMinLifetime": 3600000, "onlineAccountSignaturesMaxLifetime": 86400000, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2-self-sponsorship-algo.json b/src/test/resources/test-chain-v2-self-sponsorship-algo-v1.json similarity index 95% rename from src/test/resources/test-chain-v2-self-sponsorship-algo.json rename to src/test/resources/test-chain-v2-self-sponsorship-algo-v1.json index 04e81e21..caf8ffe7 100644 --- a/src/test/resources/test-chain-v2-self-sponsorship-algo.json +++ b/src/test/resources/test-chain-v2-self-sponsorship-algo-v1.json @@ -23,6 +23,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -88,7 +89,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-chain-v2.json b/src/test/resources/test-chain-v2.json index a57a0fd4..f867aa46 100644 --- a/src/test/resources/test-chain-v2.json +++ b/src/test/resources/test-chain-v2.json @@ -24,6 +24,7 @@ "onlineAccountSignaturesMaxLifetime": 86400000, "onlineAccountsModulusV2Timestamp": 9999999999999, "selfSponsorshipAlgoV1SnapshotTimestamp": 9999999999999, + "selfSponsorshipAlgoV2SnapshotTimestamp": 9999999999999, "mempowTransactionUpdatesTimestamp": 0, "blockRewardBatchStartHeight": 999999000, "blockRewardBatchSize": 10, @@ -89,7 +90,11 @@ "feeValidationFixTimestamp": 0, "chatReferenceTimestamp": 0, "arbitraryOptionalFeeTimestamp": 0, - "unconfirmableRewardSharesHeight": 99999999 + "unconfirmableRewardSharesHeight": 99999999, + "selfSponsorshipAlgoV2Height": 9999999, + "disableTransferPrivsTimestamp": 9999999999500, + "enableTransferPrivsTimestamp": 9999999999950, + "penaltyFixHeight": 9999999 }, "genesisInfo": { "version": 4, diff --git a/src/test/resources/test-settings-v2-penalty-fix.json b/src/test/resources/test-settings-v2-penalty-fix.json new file mode 100644 index 00000000..d575e5aa --- /dev/null +++ b/src/test/resources/test-settings-v2-penalty-fix.json @@ -0,0 +1,20 @@ +{ + "repositoryPath": "testdb", + "bitcoinNet": "TEST3", + "litecoinNet": "TEST3", + "restrictedApi": false, + "blockchainConfig": "src/test/resources/test-chain-v2-penalty-fix.json", + "exportPath": "qortal-backup-test", + "bootstrap": false, + "wipeUnconfirmedOnStart": false, + "testNtpOffset": 0, + "minPeers": 0, + "pruneBlockLimit": 100, + "bootstrapFilenamePrefix": "test-", + "dataPath": "data-test", + "tempDataPath": "data-test/_temp", + "listsPath": "lists-test", + "storagePolicy": "FOLLOWED_OR_VIEWED", + "maxStorageCapacity": 104857600, + "arrrDefaultBirthday": 1900000 +} diff --git a/src/test/resources/test-settings-v2-self-sponsorship-algo.json b/src/test/resources/test-settings-v2-self-sponsorship-algo-v1.json similarity index 95% rename from src/test/resources/test-settings-v2-self-sponsorship-algo.json rename to src/test/resources/test-settings-v2-self-sponsorship-algo-v1.json index 5ea42e66..a963b125 100644 --- a/src/test/resources/test-settings-v2-self-sponsorship-algo.json +++ b/src/test/resources/test-settings-v2-self-sponsorship-algo-v1.json @@ -3,7 +3,7 @@ "bitcoinNet": "TEST3", "litecoinNet": "TEST3", "restrictedApi": false, - "blockchainConfig": "src/test/resources/test-chain-v2-self-sponsorship-algo.json", + "blockchainConfig": "src/test/resources/test-chain-v2-self-sponsorship-algo-v1.json", "exportPath": "qortal-backup-test", "bootstrap": false, "wipeUnconfirmedOnStart": false,