Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Commit 77dbb5a

Browse files
author
Gal Rogozinski
committed
Merge branch 'release-v1.6.1'
2 parents c98d0cf + 8610396 commit 77dbb5a

File tree

65 files changed

+1551
-636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1551
-636
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ script:
5050
- mvn jacoco:report
5151

5252
after_success:
53+
#digest of packaged jar
54+
- test $TRAVIS_JDK_VERSION = "oraclejdk8" && sha256sum target/*.jar*
5355
#codacy-coverage send report. Uses Travis Env variable (CODACY_PROJECT_TOKEN)
5456
- test $TRAVIS_PULL_REQUEST = "false" && test $TRAVIS_JDK_VERSION = "oraclejdk8" && wget -O codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r '.assets[0].browser_download_url')
5557
- test $TRAVIS_PULL_REQUEST = "false" && test $TRAVIS_JDK_VERSION = "oraclejdk8" && java -jar codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml

DOCKER.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
Run the official iotaledger/iri container, passing the mandatory -p option:
44

5-
```docker run iotaledger/iri:v1.6.0-RELEASE -p 14265```
5+
```docker run iotaledger/iri:v1.6.1-RELEASE -p 14265```
66

77
This will get your a running IRI with its API listening on port 14265, no neighbours and an empty database. The IRI Docker container by default expects data at /iri/data. Use the `-v` option of the `docker run` command to mount volumes so to have persistent data. You can also pass more command line options to the docker run command and those will be passed to IRI.
88

99
If you want to use a iri.ini file with the docker container, supposing it's stored under /path/to/conf/iri.ini on your docker host, then pass `-v /path/to/conf:/iri/conf` and add -c /iri/conf/iri.ini as docker run arguments. So for example the `docker run` command above would become:
1010

11-
```docker run -v /path/to/conf:/iri/conf -v /path/to/data:/iri/data iotaledger/iri:v1.6.0-RELEASE -p 14265 -c /iri/conf/iri.ini```
11+
```docker run -v /path/to/conf:/iri/conf -v /path/to/data:/iri/data iotaledger/iri:v1.6.1-RELEASE -p 14265 -c /iri/conf/iri.ini```
1212

1313
Please refer to the IRI documentation for further command line options and iri.ini options.
1414

@@ -61,7 +61,7 @@ ExecStart=/usr/bin/docker run \
6161
-p 14265:14265 \
6262
-p 15600:15600 \
6363
-p 14600:14600/udp \
64-
iotaledger/iri:v1.6.0-RELEASE \
64+
iotaledger/iri:v1.6.1-RELEASE \
6565
-p 14265 \
6666
--zmq-enabled \
6767
--testnet

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,12 @@ IXI_DIR = ixi
116116
DEBUG = false
117117
DB_PATH = db
118118
```
119+
120+
### Special Thanks To
121+
122+
### ![alt text](https://www.yourkit.com/images/yklogo.png)
123+
124+
YourKit supports open source projects with its full-featured Java Profiler.
125+
YourKit, LLC is the creator of <a href="https://www.yourkit.com/java/profiler/">YourKit Java Profiler</a>
126+
and <a href="https://www.yourkit.com/.net/profiler/">YourKit .NET Profiler</a>,
127+
innovative and intelligent tools for profiling Java and .NET applications.

changelog.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
1.6.1
2+
- Fix: Db exists() method optimization (#1338)
3+
- Fix: Do not persist pruner state (#1342)
4+
- Fix: Reduce db access and cpu usage needed to persist spent addresses (#1332)
5+
- Fix: Added a NULL_HASH check for genesis transaction (#1309)
6+
- Feature: Fresh transactions to request (#1316)
7+
- Fix: missing user-agent header in cors (#1319)
8+
- Fix: Batch process spent addresses to avoid out of memory issues (#1314)
9+
- Fix: added a buffer to LSManager (#1286)
10+
- Fix: test existence of spent addresses db do not point to correct folder (#1305)
11+
- Change: Convert from trytes to asciiString (#1302)
12+
- Documentation: Fixed and added javadoc comments for existing classes (#1026)
13+
- Fix: Creates rest endpoint for iotaconfig related settings as suggested (#1200)
14+
- Fix: make storeMessage store transactions (#1186)
15+
- Change: add a plugin to create reproducible builds. (#1194)
16+
- Feature: Add configurable variables for spent addresses DB (#1274)
17+
- Fix: Posting invalid json to IRI will result in detailed error message (#1202)
18+
- Fix: dns reverse resolving issue for neighbors that are added with their IP. (#1255)
19+
20+
1.6.0
21+
- Feat: added config variables for local snapshots (#981)
22+
- Feat: added a generic helper class for dag traversal (#982)
23+
- Feat: renamed Milestone to MilestoneTracker (#983)
24+
- Feat: Introducing the GarbageCollector of local snapshots (#995)
25+
- Feat: Fixes + Improvements for IRI that are required for local snapshots (#1095)
26+
- Feat: Introducing several executor services for IRI (#1131)
27+
- Feat: Making IRI use the initialSnapshot and the solidEntryPoints (#1135)
28+
- MilestoneTracker and LedgerValidator rework (#1151)
29+
- Activate Local Snapshots (#1172)
30+
- Introducing a repair mechanism for corruptions in the ledger database (#1174)
31+
- Introducing a parameter validation for the local snapshot config parameters (#1175)
32+
- Introducing a dedicated Transaction Requester Background Worker (#1178)
33+
- Fix: Removed intertwined locks to prevent deadlocks (#1195)
34+
- Feat: Added an option to fast forward the ledger state (#1196)
35+
- Perf: Massively improved the performance of the replayMilestones method (#1197)
36+
- Refactor: Removed grace time from solid entry points generation (#1199)
37+
- Increase rescan performance of old milestones after IRI restart (#1204)
38+
- Refactor: Removed the old unused classes that got replaced by the local snapshots implementation (#1205)
39+
- Refactor: made boolean parameters receive a value (#1224)
40+
- Feat: Disable snapshot logic completely if disabled in the config (#1228)
41+
- Fix: Node requested old transactions forever (#1235)
42+
- Feat: Write snapshot files to temp files first (#1256)
43+
- Fix first() calls in view models (#1257)
44+
- Spentaddresses are persisted upon pruning (#1258)
45+
- Spent Addresses should be persisted in a seperate db instance (#1263)
46+
- Report local snapshot node transaction history via getNodeInfo (#1264)
47+
- Don't start node if local snapshot is loaded but there is no spent ad… (#1266)
48+
- Change the minimum value for LOCAL_SNAPSHOTS_PRUNING_DELAY (#1267)
49+
150
1.5.6
251
- Global Snapshot (#1250)
352
- Refactor: refactored DedicatedScheduledExecutorService

pom.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.iota</groupId>
77
<artifactId>iri</artifactId>
8-
<version>1.6.0-RELEASE</version>
8+
<version>1.6.1-RELEASE</version>
99
<name>IRI</name>
1010
<description>IOTA Reference Implementation</description>
1111

@@ -450,6 +450,19 @@
450450
</execution>
451451
</executions>
452452
</plugin>
453+
<plugin>
454+
<groupId>io.github.zlika</groupId>
455+
<artifactId>reproducible-build-maven-plugin</artifactId>
456+
<version>0.7</version>
457+
<executions>
458+
<execution>
459+
<phase>package</phase>
460+
<goals>
461+
<goal>strip-jar</goal>
462+
</goals>
463+
</execution>
464+
</executions>
465+
</plugin>
453466
</plugins>
454467

455468
</build>

src/main/java/com/iota/iri/BundleValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class BundleValidator {
5555
* If the bundle is invalid then an empty list will be returned.
5656
* @throws Exception if a persistence error occured
5757
*/
58-
public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot initialSnapshot, Hash tailHash) throws Exception {
58+
public List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot initialSnapshot, Hash tailHash) throws Exception {
5959

6060
TransactionViewModel tail = TransactionViewModel.fromHash(tangle, tailHash);
6161
if (tail.getCurrentIndex() != 0 || tail.getValidity() == -1) {
@@ -194,10 +194,10 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot
194194
/**
195195
* Checks that the bundle's inputs and outputs are balanced.
196196
*
197-
* @param transactionViewModels list of transactions that are in a bundle
197+
* @param transactionViewModels collection of transactions that are in a bundle
198198
* @return {@code true} if balanced, {@code false} if unbalanced or {@code transactionViewModels} is empty
199199
*/
200-
public static boolean isInconsistent(List<TransactionViewModel> transactionViewModels) {
200+
public static boolean isInconsistent(Collection<TransactionViewModel> transactionViewModels) {
201201
long value = 0;
202202
for (final TransactionViewModel bundleTransactionViewModel : transactionViewModels) {
203203
if (bundleTransactionViewModel.value() != 0) {

src/main/java/com/iota/iri/IRI.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class IRI {
4242

4343
public static final String MAINNET_NAME = "IRI";
4444
public static final String TESTNET_NAME = "IRI Testnet";
45-
public static final String VERSION = "1.6.0-RELEASE";
45+
public static final String VERSION = "1.6.1-RELEASE";
4646

4747
/**
4848
* The entry point of IRI.
@@ -60,6 +60,12 @@ public static void main(String[] args) throws Exception {
6060
IRILauncher.main(args);
6161
}
6262

63+
/**
64+
* Reads the logging configuration file and logging level from system properties. You can set this values as
65+
* arguments to the Java VM by passing <code>-Dlogback.configurationFile=/path/to/config.xml -Dlogging-level=DEBUG</code>
66+
* to the Java VM. If no system properties are specified the logback default values and logging-level INFO will
67+
* be used.
68+
*/
6369
private static void configureLogging() {
6470
String config = System.getProperty("logback.configurationFile");
6571
String level = System.getProperty("logging-level", "").toUpperCase();
@@ -178,6 +184,14 @@ private static IotaConfig createConfiguration(String[] args) {
178184
return iotaConfig;
179185
}
180186

187+
/**
188+
* Parses the command line arguments for a config file that can be provided by parameter <code>-c</code>
189+
* or parameter <code>--config</code>. If no filename was provided we fall back to <code>iota.ini</code> file.
190+
* If no <code>iota.ini</code> file can be found return null.
191+
*
192+
* @param args command line arguments passed to main method.
193+
* @return File the chosen file to use as config, or null.
194+
*/
181195
private static File chooseConfigFile(String[] args) {
182196
int index = Math.max(ArrayUtils.indexOf(args, "-c"), ArrayUtils.indexOf(args, "--config"));
183197
if (index != -1) {

src/main/java/com/iota/iri/Iota.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ public class Iota {
9595

9696
public final TransactionRequesterWorkerImpl transactionRequesterWorker;
9797

98+
public final BundleValidator bundleValidator;
99+
98100
public final Tangle tangle;
99101
public final TransactionValidator transactionValidator;
100102
public final TipsSolidifier tipsSolidifier;
@@ -137,6 +139,7 @@ public Iota(IotaConfig configuration) throws TransactionPruningException, Snapsh
137139
transactionRequesterWorker = new TransactionRequesterWorkerImpl();
138140

139141
// legacy code
142+
bundleValidator = new BundleValidator();
140143
tangle = new Tangle();
141144
messageQ = MessageQ.createWith(configuration);
142145
tipsViewModel = new TipsViewModel();
@@ -200,22 +203,22 @@ private void injectDependencies() throws SnapshotException, TransactionPruningEx
200203
//because we check whether spent addresses data exists
201204
snapshotProvider.init(configuration);
202205
spentAddressesProvider.init(configuration);
203-
spentAddressesService.init(tangle, snapshotProvider, spentAddressesProvider);
206+
spentAddressesService.init(tangle, snapshotProvider, spentAddressesProvider, bundleValidator, configuration);
204207
snapshotService.init(tangle, snapshotProvider, spentAddressesService, spentAddressesProvider, configuration);
205208
if (localSnapshotManager != null) {
206209
localSnapshotManager.init(snapshotProvider, snapshotService, transactionPruner, configuration);
207210
}
208-
milestoneService.init(tangle, snapshotProvider, snapshotService, messageQ, configuration);
211+
milestoneService.init(tangle, snapshotProvider, snapshotService, bundleValidator, messageQ, configuration);
209212
latestMilestoneTracker.init(tangle, snapshotProvider, milestoneService, milestoneSolidifier,
210213
messageQ, configuration);
211214
latestSolidMilestoneTracker.init(tangle, snapshotProvider, milestoneService, ledgerService,
212215
latestMilestoneTracker, messageQ);
213216
seenMilestonesRetriever.init(tangle, snapshotProvider, transactionRequester);
214217
milestoneSolidifier.init(snapshotProvider, transactionValidator);
215-
ledgerService.init(tangle, snapshotProvider, snapshotService, milestoneService);
218+
ledgerService.init(tangle, snapshotProvider, snapshotService, milestoneService, spentAddressesService,
219+
bundleValidator);
216220
if (transactionPruner != null) {
217-
transactionPruner.init(tangle, snapshotProvider, spentAddressesService, tipsViewModel, configuration)
218-
.restoreState();
221+
transactionPruner.init(tangle, snapshotProvider, spentAddressesService, tipsViewModel, configuration);
219222
}
220223
transactionRequesterWorker.init(tangle, transactionRequester, tipsViewModel, node);
221224
}

src/main/java/com/iota/iri/conf/BaseIotaConfig.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ public abstract class BaseIotaConfig implements IotaConfig {
9595
protected int localSnapshotsIntervalUnsynced = Defaults.LOCAL_SNAPSHOTS_INTERVAL_UNSYNCED;
9696
protected int localSnapshotsDepth = Defaults.LOCAL_SNAPSHOTS_DEPTH;
9797
protected String localSnapshotsBasePath = Defaults.LOCAL_SNAPSHOTS_BASE_PATH;
98+
protected String spentAddressesDbPath = Defaults.SPENT_ADDRESSES_DB_PATH;
99+
protected String spentAddressesDbLogPath = Defaults.SPENT_ADDRESSES_DB_LOG_PATH;
98100

99101
public BaseIotaConfig() {
100102
//empty constructor
@@ -592,6 +594,28 @@ public int getNumberOfKeysInMilestone() {
592594
return Defaults.NUM_KEYS_IN_MILESTONE;
593595
}
594596

597+
@Override
598+
public String getSpentAddressesDbPath() {
599+
return spentAddressesDbPath;
600+
}
601+
602+
@JsonProperty
603+
@Parameter(names = {"--spent-addresses-db-path"}, description = SnapshotConfig.Descriptions.SPENT_ADDRESSES_DB_PATH)
604+
protected void setSpentAddressesDbPath(String spentAddressesDbPath) {
605+
this.spentAddressesDbPath = spentAddressesDbPath;
606+
}
607+
608+
@Override
609+
public String getSpentAddressesDbLogPath() {
610+
return spentAddressesDbLogPath;
611+
}
612+
613+
@JsonProperty
614+
@Parameter(names = {"--spent-addresses-db-log-path"}, description = SnapshotConfig.Descriptions.SPENT_ADDRESSES_DB_LOG_PATH)
615+
protected void setSpentAddressesDbLogPath(String spentAddressesDbLogPath) {
616+
this.spentAddressesDbLogPath = spentAddressesDbLogPath;
617+
}
618+
595619
@Override
596620
public boolean isZmqEnabled() {
597621
return zmqEnabled;
@@ -811,6 +835,8 @@ public interface Defaults {
811835
int LOCAL_SNAPSHOTS_INTERVAL_UNSYNCED = 1000;
812836
int LOCAL_SNAPSHOTS_DEPTH = 100;
813837
int LOCAL_SNAPSHOTS_DEPTH_MIN = 100;
838+
String SPENT_ADDRESSES_DB_PATH = "spent-addresses-db";
839+
String SPENT_ADDRESSES_DB_LOG_PATH = "spent-addresses-log";
814840

815841
String LOCAL_SNAPSHOTS_BASE_PATH = "mainnet";
816842
String SNAPSHOT_FILE = "/snapshotMainnet.txt";

src/main/java/com/iota/iri/conf/ConfigFactory.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@
1313
import java.io.IOException;
1414
import java.util.Properties;
1515

16+
/**
17+
* Creates the global {@link IotaConfig} object with iri specific settings.
18+
*/
1619
public class ConfigFactory {
1720

21+
/**
22+
* Creates the {@link IotaConfig} object for {@link TestnetConfig} or {@link MainnetConfig}.
23+
*
24+
* @param isTestnet true if {@link TestnetConfig} should be created.
25+
* @return return the {@link IotaConfig} configuration.
26+
*/
1827
public static IotaConfig createIotaConfig(boolean isTestnet) {
1928
IotaConfig iotaConfig;
2029
if (isTestnet) {
@@ -26,8 +35,18 @@ public static IotaConfig createIotaConfig(boolean isTestnet) {
2635
return iotaConfig;
2736
}
2837

29-
public static IotaConfig createFromFile(File configFile, boolean testnet) throws IOException,
30-
IllegalArgumentException {
38+
/**
39+
* Creates the {@link IotaConfig} object for {@link TestnetConfig} or {@link MainnetConfig} from config file. Parse
40+
* the config file for <code>TESTNET=true</code>. If <code>TESTNET=true</code> is found we creates the
41+
* {@link TestnetConfig} object, else creates the {@link MainnetConfig}.
42+
*
43+
* @param configFile A property file with configuration options.
44+
* @param testnet When true a {@link TestnetConfig} is created.
45+
* @return the {@link IotaConfig} configuration.
46+
*
47+
* @throws IOException When config file could not be found.
48+
*/
49+
public static IotaConfig createFromFile(File configFile, boolean testnet) throws IOException {
3150
IotaConfig iotaConfig;
3251

3352
try (FileInputStream confStream = new FileInputStream(configFile)) {

0 commit comments

Comments
 (0)