From d04d93bb5a9fca27ff048ed0fa1cd446a8e844c3 Mon Sep 17 00:00:00 2001 From: rico666 Date: Sun, 16 Dec 2018 10:33:19 +0100 Subject: [PATCH] 2.2.6 -> 2.2.7 RC --- .gitignore | 4 ++- README.md | 9 +++--- conf/brs-default.properties | 3 ++ pom.xml | 2 +- src/brs/BlockchainProcessor.java | 2 ++ src/brs/BlockchainProcessorImpl.java | 26 ++++++++++++++++- src/brs/Burst.java | 4 +-- src/brs/Constants.java | 2 +- src/brs/TransactionProcessor.java | 4 ++- src/brs/TransactionProcessorImpl.java | 9 ++++-- src/brs/http/APIServlet.java | 1 + src/brs/http/GetMyPeerInfo.java | 29 +++++++++++++++++++ src/brs/peer/GetUnconfirmedTransactions.java | 6 +--- src/brs/peer/PeerImpl.java | 14 +++++++-- src/brs/peer/PeerServlet.java | 3 ++ src/brs/peer/Peers.java | 29 +++++++++++++------ src/brs/props/Props.java | 4 +++ .../UnconfirmedTransactionStore.java | 2 ++ .../UnconfirmedTransactionStoreImpl.java | 11 ++++++- .../UnconfirmedTransactionStoreTest.java | 14 +++++---- 20 files changed, 141 insertions(+), 37 deletions(-) create mode 100644 src/brs/http/GetMyPeerInfo.java diff --git a/.gitignore b/.gitignore index f29cfce61..0f1fe229a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ burst.jar brs.log brs.log.* /conf/logging.properties -/conf/brs.properties* +/conf/brs.properties.MainNet +/conf/brs.properties.Testnet +/conf/brs.properties.PrivNet _config.yml /html/ui/doc/* target diff --git a/README.md b/README.md index 3980d3ebe..b511e9f41 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ If running for the first time, if upgrading your wallet config from 1.3.6cg +(this feature will be removed in 2.2.8) ``` burst.sh upgrade @@ -105,8 +106,8 @@ DB.Password=yourpassword `latest` : Latest tag of the BRS with H2 database `mariadb` : Latest tag of the BRS with MariaDB database -`2.2.3-h2`, `2.2-h2` : Version 2.2.3 of the BRS with H2 database -`2.2.3-mariadb`, `2.2-mariadb` : Version 2.2.3 of the BRS with MariaDB database +`2.2.7-h2`, `2.2-h2`, `2-h2` : Version 2.2.7 of the BRS with H2 database +`2.2.7-mariadb`, `2.2-mariadb`, `2-mariadb` : Version 2.2.7 of the BRS with MariaDB database **Note (H2 only):** @@ -126,7 +127,7 @@ version: '3' services: burstcoin: - image: burstcoin/core:2.2-mariadb + image: pocconsortium/burstcoin:2-mariadb restart: always depends_on: - mariadb @@ -147,7 +148,7 @@ services: ##### H2 ``` -docker run -p 8123:8123 -p 8125:8125 -v "$(pwd)"/burst_db:/db -d burstcoin/core:2.2-h2 +docker run -p 8123:8123 -p 8125:8125 -v "$(pwd)"/burst_db:/db -d pocconsortium/burstcoin:2-h2 ``` diff --git a/conf/brs-default.properties b/conf/brs-default.properties index d3ad9a898..25ecfcd95 100644 --- a/conf/brs-default.properties +++ b/conf/brs-default.properties @@ -92,6 +92,9 @@ P2P.maxUnconfirmedTransactions = 8192 # Max percentage of unconfirmed transactions that have a full hash reference to another transaction kept in cache P2P.maxUnconfirmedTransactionsFullHashReferencePercentage = 5 +# Max amount of raw UT bytes we will send to someone through both push and pull. Keep in mind that the resulting JSON size will always be bigger. +P2P.maxUTRawSizeBytesToSend = 175000 + # JETTY pass-through options. See documentation at # https://www.eclipse.org/jetty/documentation/9.2.22.v20170531/dos-filter.html # P2P section: diff --git a/pom.xml b/pom.xml index bcf081411..7db31eb3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ burstcoin burstcoin - 2.2.6 + 2.2.7 Burstcoin Reference Software https://github.com/PoC-Consortium/burstcoin diff --git a/src/brs/BlockchainProcessor.java b/src/brs/BlockchainProcessor.java index afc2cd3f3..c6e44b050 100644 --- a/src/brs/BlockchainProcessor.java +++ b/src/brs/BlockchainProcessor.java @@ -36,6 +36,8 @@ void generateBlock(String secretPhrase, byte[] publicKey, Long nonce) void validateAtNextScan(); + Integer getWalletTTSD(); + List popOffTo(int height); class BlockNotAcceptedException extends BurstException { diff --git a/src/brs/BlockchainProcessorImpl.java b/src/brs/BlockchainProcessorImpl.java index 47e72784f..cfef209b9 100644 --- a/src/brs/BlockchainProcessorImpl.java +++ b/src/brs/BlockchainProcessorImpl.java @@ -99,6 +99,10 @@ public final class BlockchainProcessorImpl implements BlockchainProcessor { private boolean forceScan; private boolean validateAtScan; + private boolean forgeFatBlocks; + + private Integer ttsd; + private final Runnable debugInfoThread = () -> { logger.info("Unverified blocks: " + downloadCache.getUnverifiedSize()); logger.info("Blocks in cache: " + downloadCache.size()); @@ -145,6 +149,11 @@ public BlockchainProcessorImpl(ThreadPool threadPool, BlockService blockService, forceScan = propertyService.getBoolean(Props.DEV_FORCE_SCAN); validateAtScan = propertyService.getBoolean(Props.DEV_FORCE_VALIDATE); + forgeFatBlocks = "fat".equals(propertyService.getString(Props.BRS_FORGING_STRATEGY)); + + if(forgeFatBlocks) { + ttsd = 400; + } blockListeners.addListener(block -> { if (block.getHeight() % 5000 == 0) { @@ -787,6 +796,11 @@ public void validateAtNextScan() { validateAtScan = true; } + @Override + public Integer getWalletTTSD() { + return this.ttsd; + } + void setGetMoreBlocks(boolean getMoreBlocks) { this.getMoreBlocks = getMoreBlocks; } @@ -825,6 +839,16 @@ private void addGenesisBlock() { } private void pushBlock(final Block block) throws BlockNotAcceptedException { + if(ttsd != null) { + ttsd--; + + if (ttsd < 0) { + logger.warn("Tick tocks, been crafting too many fat blocks"); + Burst.shutdown(false); + System.exit(0); + } + } + synchronized (transactionProcessor.getUnconfirmedTransactionsSyncObj()) { stores.beginTransaction(); int curTime = timeService.getEpochTime(); @@ -1144,7 +1168,7 @@ else if ( transaction.getSize() > payloadSize ) { continue COLLECT_TRANSACTIONS; } - Long slotFee = Burst.getFluxCapacitor().isActive(PRE_DYMAXION) ? blockSize * FEE_QUANT : ONE_BURST; + Long slotFee = Burst.getFluxCapacitor().isActive(PRE_DYMAXION) ? (forgeFatBlocks ? 1 : blockSize) * FEE_QUANT : ONE_BURST; if (transaction.getFeeNQT() >= slotFee) { // transaction can only be handled if all referenced ones exist if (hasAllReferencedTransactions(transaction, transaction.getTimestamp(), 0)) { diff --git a/src/brs/Burst.java b/src/brs/Burst.java index b95089a6c..4b3e2ee8d 100644 --- a/src/brs/Burst.java +++ b/src/brs/Burst.java @@ -66,10 +66,8 @@ public final class Burst { - public static final String VERSION = "2.2.6"; + public static final String VERSION = "2.2.7"; public static final String APPLICATION = "BRS"; - public static final String LEGACY_APP = "NRS"; - public static final String LEGACY_VER = "1.2.9"; private static final String DEFAULT_PROPERTIES_NAME = "brs-default.properties"; diff --git a/src/brs/Constants.java b/src/brs/Constants.java index 3cbc2f2c1..4a9ff0c6d 100644 --- a/src/brs/Constants.java +++ b/src/brs/Constants.java @@ -67,7 +67,7 @@ public final class Constants { public static final int MAX_AUTOMATED_TRANSACTION_NAME_LENGTH = 30; public static final int MAX_AUTOMATED_TRANSACTION_DESCRIPTION_LENGTH = 1000; - public static final String MIN_VERSION = "2.2.1"; + public static final String MIN_VERSION = "2.2.6"; static final long UNCONFIRMED_POOL_DEPOSIT_NQT = (Burst.getPropertyService().getBoolean(Props.DEV_TESTNET) ? 50 : 100) * ONE_BURST; diff --git a/src/brs/TransactionProcessor.java b/src/brs/TransactionProcessor.java index b1e3aede9..094e886be 100644 --- a/src/brs/TransactionProcessor.java +++ b/src/brs/TransactionProcessor.java @@ -17,7 +17,9 @@ enum Event { List getAllUnconfirmedTransactions(); - List getAllUnconfirmedTransactionsFor(Peer peer, long limitInBytes); + int getAmountUnconfirmedTransactions(); + + List getAllUnconfirmedTransactionsFor(Peer peer); void markFingerPrintsOf(Peer peer, List transactions); diff --git a/src/brs/TransactionProcessorImpl.java b/src/brs/TransactionProcessorImpl.java index b5baa1c40..8bbce8bdd 100644 --- a/src/brs/TransactionProcessorImpl.java +++ b/src/brs/TransactionProcessorImpl.java @@ -153,7 +153,12 @@ public List getAllUnconfirmedTransactions() { } @Override - public List getAllUnconfirmedTransactionsFor(Peer peer, long limitInBytes) { + public int getAmountUnconfirmedTransactions() { + return unconfirmedTransactionStore.getAmount(); + } + + @Override + public List getAllUnconfirmedTransactionsFor(Peer peer) { return unconfirmedTransactionStore.getAllFor(peer); } @@ -363,7 +368,7 @@ private List processTransactions(Collection transactio private int broadcastToPeers(boolean toAll) { List peersToSendTo = toAll ? Peers.getActivePeers().stream().limit(100).collect(Collectors.toList()) : Peers.getAllActivePriorityPlusSomeExtraPeers(); - logger.info("Queueing up {} Peers for feeding", peersToSendTo.size()); + logger.trace("Queueing up {} Peers for feeding", peersToSendTo.size()); for(Peer p: peersToSendTo) { Peers.feedingTime(p, foodDispenser, doneFeedingLog); diff --git a/src/brs/http/APIServlet.java b/src/brs/http/APIServlet.java index ad24efccb..2ce4aeb6e 100644 --- a/src/brs/http/APIServlet.java +++ b/src/brs/http/APIServlet.java @@ -115,6 +115,7 @@ public APIServlet(TransactionProcessor transactionProcessor, Blockchain blockcha map.put("getMyInfo", GetMyInfo.instance); //map.put("getNextBlockGenerators", GetNextBlockGenerators.instance); map.put("getPeer", GetPeer.instance); + map.put("getMyPeerInfo", new GetMyPeerInfo(blockchainProcessor, transactionProcessor)); map.put("getPeers", GetPeers.instance); //map.put("getPoll", GetPoll.instance); //map.put("getPollIds", GetPollIds.instance); diff --git a/src/brs/http/GetMyPeerInfo.java b/src/brs/http/GetMyPeerInfo.java new file mode 100644 index 000000000..b3bf78716 --- /dev/null +++ b/src/brs/http/GetMyPeerInfo.java @@ -0,0 +1,29 @@ +package brs.http; + +import brs.BlockchainProcessor; +import brs.TransactionProcessor; +import javax.servlet.http.HttpServletRequest; +import org.json.simple.JSONObject; +import org.json.simple.JSONStreamAware; + +public final class GetMyPeerInfo extends APIServlet.APIRequestHandler { + + private final BlockchainProcessor blockchainProcessor; + private final TransactionProcessor transactionProcessor; + + public GetMyPeerInfo(BlockchainProcessor blockchainProcessor, TransactionProcessor transactionProcessor) { + super(new APITag[]{APITag.INFO}); + this.blockchainProcessor = blockchainProcessor; + this.transactionProcessor = transactionProcessor; + } + + @Override + JSONStreamAware processRequest(HttpServletRequest req) { + + JSONObject response = new JSONObject(); + response.put("walletTTSD", blockchainProcessor.getWalletTTSD()); + response.put("utsInStore", transactionProcessor.getAmountUnconfirmedTransactions()); + return response; + } + +} diff --git a/src/brs/peer/GetUnconfirmedTransactions.java b/src/brs/peer/GetUnconfirmedTransactions.java index 034d1da01..c86fae058 100644 --- a/src/brs/peer/GetUnconfirmedTransactions.java +++ b/src/brs/peer/GetUnconfirmedTransactions.java @@ -25,10 +25,7 @@ final class GetUnconfirmedTransactions extends PeerServlet.ExtendedPeerRequestHa ExtendedProcessRequest extendedProcessRequest(JSONObject request, Peer peer) { JSONObject response = new JSONObject(); - // TODO Brabantian limit should be passed how? From PeerInfo somehow? Math.min(x, y); - final List unconfirmedTransactions = transactionProcessor.getAllUnconfirmedTransactionsFor(peer, 1000L); - - //long newLastUnconfirmedTransactionTimestamp = unconfirmedTransactionsOverview.getTimestamp(); + final List unconfirmedTransactions = transactionProcessor.getAllUnconfirmedTransactionsFor(peer); JSONArray transactionsData = new JSONArray(); for (Transaction transaction : unconfirmedTransactions) { @@ -36,7 +33,6 @@ ExtendedProcessRequest extendedProcessRequest(JSONObject request, Peer peer) { } response.put(UNCONFIRMED_TRANSACTIONS_RESPONSE, transactionsData); - // response.put(LAST_UNCONFIRMED_TRANSACTION_TIMESTAMP_RESPONSE, unconfirmedTransactionsOverview.getTimestamp()); return new ExtendedProcessRequest(response, () -> transactionProcessor.markFingerPrintsOf(peer, unconfirmedTransactions)); } diff --git a/src/brs/peer/PeerImpl.java b/src/brs/peer/PeerImpl.java index 0d83584f2..d220d4cba 100644 --- a/src/brs/peer/PeerImpl.java +++ b/src/brs/peer/PeerImpl.java @@ -118,10 +118,18 @@ public String getVersion() { } // semantic versioning for peer versions. here: ">=" negate it for "<" - public boolean isHigherOrEqualVersionThan(String ComparisonVersion) { + public boolean isHigherOrEqualVersionThan(String ourVersion) { + return isHigherOrEqualVersion(ourVersion, version); + } + + public static boolean isHigherOrEqualVersion(String ourVersion, String possiblyLowerVersion) { + if(possiblyLowerVersion == null || possiblyLowerVersion.isEmpty()) { + return false; + } + Pattern pattern = Pattern.compile("^(\\d+)\\.(\\d+)\\.(\\d+)?"); - Matcher matchPeer = pattern.matcher(version); - Matcher matchCompare = pattern.matcher(ComparisonVersion); + Matcher matchPeer = pattern.matcher(possiblyLowerVersion); + Matcher matchCompare = pattern.matcher(ourVersion); if (matchPeer.find() && matchCompare.find()) { // if both peer version and our comparison version are sane // we have simplified versions with 3 limbs: X.Y.Z diff --git a/src/brs/peer/PeerServlet.java b/src/brs/peer/PeerServlet.java index d5f2b2ee0..c5155fec2 100644 --- a/src/brs/peer/PeerServlet.java +++ b/src/brs/peer/PeerServlet.java @@ -98,6 +98,9 @@ public void init(ServletConfig config) throws ServletException { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { + if(! Peers.isSupportedUserAgent(req.getHeader("User-Agent"))) { + return; + } PeerImpl peer = null; JSONStreamAware response; diff --git a/src/brs/peer/Peers.java b/src/brs/peer/Peers.java index e7f9d3715..7a01c9572 100644 --- a/src/brs/peer/Peers.java +++ b/src/brs/peer/Peers.java @@ -1,5 +1,7 @@ package brs.peer; +import static brs.Constants.MIN_VERSION; +import static brs.peer.PeerImpl.isHigherOrEqualVersion; import static brs.props.Props.P2P_ENABLE_TX_REBROADCAST; import static brs.props.Props.P2P_SEND_TO_LIMIT; import static brs.util.JSON.prepareRequest; @@ -12,6 +14,7 @@ import brs.util.*; import java.util.function.BiConsumer; import java.util.function.Function; +import java.util.stream.Collectors; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.gzip.GzipHandler; @@ -44,6 +47,14 @@ public final class Peers { private static final Logger logger = LoggerFactory.getLogger(Peers.class); + public static boolean isSupportedUserAgent(String header) { + if(header == null || header.isEmpty() || ! header.trim().startsWith("BRS/")) { + return false; + } else { + return isHigherOrEqualVersion(MIN_VERSION, header.trim().substring("BRS/".length())); + } + } + public enum Event { BLACKLIST, UNBLACKLIST, DEACTIVATE, REMOVE, DOWNLOADED_VOLUME, UPLOADED_VOLUME, WEIGHT, @@ -432,7 +443,7 @@ public void run() { * if we loose Internet connection */ - if (!peer.isHigherOrEqualVersionThan(Burst.LEGACY_VER) + if (!peer.isHigherOrEqualVersionThan(MIN_VERSION) || (peer.getState() != Peer.State.CONNECTED && !peer.isBlacklisted() && peers.size() > maxNumberOfConnectedPublicPeers)) { removePeer(peer); } @@ -456,7 +467,7 @@ public void run() { for (PeerImpl peer : peers.values()) { if (peer.getState() == Peer.State.CONNECTED && now - peer.getLastUpdated() > 3600) { peer.connect(timeService.getEpochTime()); - if (!peer.isHigherOrEqualVersionThan(Burst.LEGACY_VER) || + if (!peer.isHigherOrEqualVersionThan(MIN_VERSION) || (peer.getState() != Peer.State.CONNECTED && !peer.isBlacklisted() && peers.size() > maxNumberOfConnectedPublicPeers)) { removePeer(peer); } @@ -479,7 +490,7 @@ private void updateSavedPeers() { if (peer.getAnnouncedAddress() != null && ! peer.isBlacklisted() && ! peer.isWellKnown() - && peer.isHigherOrEqualVersionThan(Burst.LEGACY_VER)) { + && peer.isHigherOrEqualVersionThan(MIN_VERSION)) { currentPeers.add(peer.getAnnouncedAddress()); } } @@ -562,7 +573,7 @@ public void run() { && myPeer.getState() == Peer.State.CONNECTED && myPeer.shareAddress() && ! addedAddresses.contains(myPeer.getAnnouncedAddress()) && ! myPeer.getAnnouncedAddress().equals(peer.getAnnouncedAddress()) - && myPeer.isHigherOrEqualVersionThan(Burst.LEGACY_VER) + && myPeer.isHigherOrEqualVersionThan(MIN_VERSION) ) { myPeers.add(myPeer.getAnnouncedAddress()); } @@ -817,16 +828,16 @@ private static void feedPeer(Peer peer, Function> foodDi List transactionsToSend = foodDispenser.apply(peer); if(! transactionsToSend.isEmpty()) { - logger.info("Feeding {} {} transactions", peer.getPeerAddress(), transactionsToSend.size()); + logger.trace("Feeding {} {} transactions", peer.getPeerAddress(), transactionsToSend.size()); JSONObject response = peer.send(sendUnconfirmedTransactionsRequest(transactionsToSend)); if(response != null && response.get("error") == null) { doneFeedingLog.accept(peer, transactionsToSend); } else { - logger.error("Error feeding {} transactions: {} error: {}", peer.getPeerAddress(), transactionsToSend.stream().map(t -> t.getId()), response); + logger.warn("Error feeding {} transactions: {} error: {}", peer.getPeerAddress(), transactionsToSend.stream().map(t -> t.getId()).collect(Collectors.toList()), response); } } else { - logger.info("No need to feed {}", peer.getPeerAddress()); + logger.trace("No need to feed {}", peer.getPeerAddress()); } beingProcessed.remove(peer); @@ -853,9 +864,9 @@ private static JSONStreamAware sendUnconfirmedTransactionsRequest(List transactions); void removeForgedTransactions(List transactions); + + int getAmount(); } diff --git a/src/brs/unconfirmedtransactions/UnconfirmedTransactionStoreImpl.java b/src/brs/unconfirmedtransactions/UnconfirmedTransactionStoreImpl.java index d26209d5f..56df38f86 100644 --- a/src/brs/unconfirmedtransactions/UnconfirmedTransactionStoreImpl.java +++ b/src/brs/unconfirmedtransactions/UnconfirmedTransactionStoreImpl.java @@ -43,6 +43,8 @@ public class UnconfirmedTransactionStoreImpl implements UnconfirmedTransactionSt private int totalSize; private final int maxSize; + private final int maxRawUTBytesToSend; + private int numberUnconfirmedTransactionsFullHash; private final int maxPercentageUnconfirmedTransactionsFullHash; @@ -65,6 +67,8 @@ public UnconfirmedTransactionStoreImpl(TimeService timeService, PropertyService this.maxSize = propertyService.getInt(Props.P2P_MAX_UNCONFIRMED_TRANSACTIONS); this.totalSize = 0; + this.maxRawUTBytesToSend = propertyService.getInt(Props.P2P_MAX_UNCONFIRMED_TRANSACTIONS_RAW_SIZE_BYTES_TO_SEND); + this.maxPercentageUnconfirmedTransactionsFullHash = propertyService.getInt(Props.P2P_MAX_PERCENTAGE_UNCONFIRMED_TRANSACTIONS_FULL_HASH_REFERENCE); this.numberUnconfirmedTransactionsFullHash = 0; @@ -162,7 +166,7 @@ public List getAllFor(Peer peer) { final ArrayList resultList = new ArrayList<>(); - long roomLeft = 175000; + long roomLeft = this.maxRawUTBytesToSend; for (Transaction t : untouchedTransactions) { roomLeft -= t.getSize(); @@ -230,6 +234,11 @@ public void removeForgedTransactions(List transactions) { } } + @Override + public int getAmount() { + return totalSize; + } + private boolean transactionIsCurrentlyInCache(Transaction transaction) { final List amountSlot = internalStore.get(amountSlotForTransaction(transaction)); return amountSlot != null && amountSlot.stream().anyMatch(t -> t.getId() == transaction.getId()); diff --git a/test/java/brs/unconfirmedtransactions/UnconfirmedTransactionStoreTest.java b/test/java/brs/unconfirmedtransactions/UnconfirmedTransactionStoreTest.java index c0a502858..5889636af 100644 --- a/test/java/brs/unconfirmedtransactions/UnconfirmedTransactionStoreTest.java +++ b/test/java/brs/unconfirmedtransactions/UnconfirmedTransactionStoreTest.java @@ -238,18 +238,22 @@ public void unconfirmedTransactionGetsDeniedForNotEnoughUnconfirmedBalance() thr public void addingNewUnconfirmedTransactionWithSameIDResultsInNothingChanging() throws ValidationException { when(mockBlockChain.getHeight()).thenReturn(20); + Peer mockPeer = mock(Peer.class); + + when(mockPeer.getPeerAddress()).thenReturn("mockPeer"); + Builder transactionBuilder = new Builder((byte) 1, TestConstants.TEST_PUBLIC_KEY_BYTES, 1, Constants.MAX_BALANCE_NQT - 100000, timeService.getEpochTime() + 50000, (short) 500, ORDINARY_PAYMENT) .id(1).senderId(123L); Transaction transaction1 = transactionBuilder.build(); transaction1.sign(TestConstants.TEST_SECRET_PHRASE); - t.put(transaction1, null); + t.put(transaction1, mockPeer); Transaction transaction2 = transactionBuilder.build(); transaction2.sign(TestConstants.TEST_SECRET_PHRASE); - t.put(transaction2, null); + t.put(transaction2, mockPeer); assertEquals(1, t.getAll().size()); } @@ -260,7 +264,7 @@ public void whenMaximumNumberOfTransactionsWithFullHashReferenceIsReachedFollowi when(mockBlockChain.getHeight()).thenReturn(20); - for (int i = 1; i <= 500; i++) { + for (int i = 1; i <= 414; i++) { Transaction transaction = new Transaction.Builder((byte) 1, TestConstants.TEST_PUBLIC_KEY_BYTES, i, FEE_QUANT * 2, timeService.getEpochTime() + 50000, (short) 500, ORDINARY_PAYMENT) .id(i).senderId(123L).referencedTransactionFullHash("b33f").build(); transaction.sign(TestConstants.TEST_SECRET_PHRASE); @@ -276,7 +280,7 @@ public void whenMaximumNumberOfTransactionsForSlotSizeIsReachedFollowingOnesAreI when(mockBlockChain.getHeight()).thenReturn(20); - for (int i = 1; i <= 500; i++) { + for (int i = 1; i <= 365; i++) { Transaction transaction = new Transaction.Builder((byte) 1, TestConstants.TEST_PUBLIC_KEY_BYTES, i, FEE_QUANT, timeService.getEpochTime() + 50000, (short) 500, ORDINARY_PAYMENT) .id(i).senderId(123L).build(); transaction.sign(TestConstants.TEST_SECRET_PHRASE); @@ -285,7 +289,7 @@ public void whenMaximumNumberOfTransactionsForSlotSizeIsReachedFollowingOnesAreI assertEquals(360, t.getAll().size()); - for (int i = 1; i <= 800; i++) { + for (int i = 1; i <= 725; i++) { Transaction transaction = new Transaction.Builder((byte) 1, TestConstants.TEST_PUBLIC_KEY_BYTES, i, FEE_QUANT * 2, timeService.getEpochTime() + 50000, (short) 500, ORDINARY_PAYMENT) .id(i).senderId(123L).build(); transaction.sign(TestConstants.TEST_SECRET_PHRASE);