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

Commit

Permalink
Merge branch 'release-v1.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gal Rogozinski committed Jul 10, 2019
2 parents c2ecd17 + 2d60344 commit 6e0f635
Show file tree
Hide file tree
Showing 109 changed files with 7,117 additions and 2,350 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/.idea
/bin
/mainnetdb
/spent-addresses-db
/spent-addresses-log
/mainnet.log
/*.iml
.classpath
Expand Down Expand Up @@ -87,4 +89,4 @@ $RECYCLE.BIN/
*.lnk


# End of https://www.gitignore.io/api/osx,linux,windows
# End of https://www.gitignore.io/api/osx,linux,windows
23 changes: 23 additions & 0 deletions Security.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<h2>Responsible disclosure policy</h2>

At the IOTA Foundation, we consider the security of our systems a top priority. But no matter how much effort we put into system security, there can still be vulnerabilities present. If you've discovered a vulnerability, please follow the guidelines below to report it to our security team:
<ul>
<li>E-mail your findings to [email protected]. If the report contains highly sensitive information, please consider encrypting your findings using our [email protected] (466385BD0B40D9550F93C04746A440CCE5664A64) PGP key.</li>
</ul>
Please follow these rules when testing/reporting vulnerabilities:
<ul>
<li>Do not take advantage of the vulnerability you have discovered, for example by downloading more data than is necessary to demonstrate the vulnerability.</li>
<li>Do not read, modify or delete data that isn't you own.</li>
<li>We ask that you do not to disclosure the problem to third parties until it has been resolved.</li>
<li>The scope of the program is limited to technical vulnerabilities in IOTA Foundations's web applications and open source software packages distributed through GitHub, please do not try to test physical security or attempt phishing attacks against our employees, and so on.</li>
<li>Out of concern for the availability of our services to all users, please do not attempt to carry out DoS attacks, leverage black hat SEO techniques, spam people, and do other similarly questionable things. We also discourage the use of any vulnerability testing tools that automatically generate significant volumes of traffic.</li>
</ul>
What we promise:
<ul>
<li>We will respond to your report within 3 business days with our evaluation of the report and an expected resolution date.</li>
<li>If you have followed the instructions above, we will not take any legal action against you in regard to the report.</li>
<li>We will keep you informed during all stages of resolving the problem.</li>
<li>To show our appreciation for your effort and cooperation during the report, we will list your name and a link to a personal website/social network profile on the page below so that the public can know you've helped keep the IOTA Foundation secure.</li>
</ul>
We sincerely appreciate the efforts of security researchers in keeping our community safe.

23 changes: 23 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
1.8.0

- Feature: new networking infrastructure, new network rules, and batched BCT curl (#1393)
* UDP support is dropped
* Performs handshake upon peering
* Protocol version support
* Not compatible with older versions of IRI
* The following configuration options are dropped:
UDP_RECEIVER_PORT
TCP_RECEIVER_PORT
MAX_PEERS
DNS_REFRESHER_ENABLED
DNS_RESOLUTION_ENABLED
* The following configuration options are added:
NEIGHBORING_SOCKET_ADDRESS— defines the socket address to bind the TCP socket to.
NEIGHBORING_SOCKET_PORT— defines the port of the TCP socket to use.
RECONNECT_ATTEMPT_INTERVAL_SECONDS— defines the interval at which to try to reconnect/disconnect wanted neighbors.
AUTO_TETHERING_ENABLED — controls auto-tethering, this was previously controlled via TESTNET true, default is false (also in testnet mode).
MAX_NEIGHBORS— rename of MAX_PEERS, defines the max number of connected neighbors.

- Fix: set arrival time in millis (not seconds) (#766)


1.7.1

- Feature: Add getAllAddresses to the spentAdddresses provider. This is to enable exporting with IXI (#1495)
Expand Down
16 changes: 13 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.iota</groupId>
<artifactId>iri</artifactId>
<version>1.7.1-RELEASE</version>
<version>1.8.0-RELEASE</version>
<name>IRI</name>
<description>IOTA Reference Implementation</description>

Expand All @@ -21,6 +21,7 @@
<javadoc-version>3.1.0</javadoc-version>
<checkstyle-version>3.0.0</checkstyle-version>
<undertow.version>1.4.26.Final</undertow.version>
<zero-allocation-hashing.version>0.8</zero-allocation-hashing.version>
<jacoco.version>0.7.9</jacoco.version>
<!-- Setting the checkstyle.config.location here will make checkstyle use this file in every maven target.
This variable will be load by checkstyle plugin automatically. It is more global than setting the
Expand Down Expand Up @@ -174,8 +175,8 @@
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<artifactId>mockito-core</artifactId>
<version>2.27.0</version>
<scope>test</scope>
</dependency>

Expand All @@ -186,6 +187,12 @@
<scope>compile</scope>
</dependency>

<dependency>
<groupId>net.openhft</groupId>
<artifactId>zero-allocation-hashing</artifactId>
<version>${zero-allocation-hashing.version}</version>
</dependency>

<dependency>
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
Expand Down Expand Up @@ -410,6 +417,9 @@
not used anymore
<urn>org.reflections:reflections:0.9.10:jar:null:compile:3812159b1b4b7c296fa80f53eed6362961eb85da</urn>
-->
<urn>
net.openhft:zero-allocation-hashing:${zero-allocation-hashing.version}:jar:null:compile:9e32cfe154dca19e6024d2faa6027d6cad8cea3c
</urn>
<urn>
com.jayway.restassured:rest-assured:2.9.0:jar:null:test:d0d5b6720a58472ab99287c931a8205373d6e7b2
</urn>
Expand Down
2 changes: 2 additions & 0 deletions python-regression/IXI/LocalSnapshots.ixi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# LocalSnapshots.ixi
A tool for fetching data from a running node's local snapshots.
58 changes: 58 additions & 0 deletions python-regression/IXI/LocalSnapshots.ixi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
var System = java.lang.System;

var snapshotState = com.iota.iri.service.snapshot.snapshotState;
var snapshotMeta = com.iota.iri.service.snapshot.snapshotMetaData;

var snapshotProvider = IOTA.snapshotProvider;

var iri = com.iota.iri;
var Callable = iri.service.CallableRequest;
var Response = iri.service.dto.IXIResponse;
var ErrorResponse = iri.service.dto.ErrorResponse;


function getInitialSnapshotClone(){
return snapshotProvider.getInitialSnapshot().clone();
}

function getLatestSnapshotClone(){
return snapshotProvider.getLatestSnapshot().clone();
}


function getSnapshotState(){
var ledgerState = getInitialSnapshotClone();

return Response.create({
index: ledgerState.getIndex(),
state: ledgerState.getBalances()
});

}

function getSnapshotMetaData(){
var ledgerState = getInitialSnapshotClone();

return Response.create({
index: ledgerState.getIndex(),
metaData: ledgerState.getSeenMilestones()
});
}


function getSnapshotIndexes(){
//console.log("Fetching balances");
var ledgerState = getLatestSnapshotClone();

return Response.create({
initialIndex: ledgerState.getInitialIndex(),
currentIndex: ledgerState.getIndex(),
});
}




API.put("getIndexes", new Callable({ call: getSnapshotIndexes }))
API.put("getState", new Callable({ call: getSnapshotState }))
API.put("getMetaData", new Callable({ call: getSnapshotMetaData }))
3 changes: 3 additions & 0 deletions python-regression/IXI/LocalSnapshots.ixi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "index.js"
}
7 changes: 4 additions & 3 deletions python-regression/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
install_requires=[
'pyota',
'aloe',
'pyyaml'
]
)
'pyyaml',
]
)

Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ Feature: Test API calls on Machine 1
|keys |
|address |
|numberOfAllTransactions |
|numberOfRandomTransactionRequests |
|numberOfNewTransactions |
|numberOfInvalidTransactions |
|numberOfStaleTransactions |
|numberOfSentTransactions |
|numberOfRandomTransactionRequests |
|numberOfDroppedSentPackets |
|connected |
|connectionType |


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Feature: Test Bootstrapping With LS
A test to determine whether or not nodes can bootstrap and sync correctly from Local Snapshot Files and DB's. One
permanode will be started containing all the relevant files/folders for a full sync upon start. Two more nodes will
be started, connected to this node and one another: One will have only a DB and snapshot file, while the other will
have only the snapshot meta and state file, along with the spent addresses DB and the snapshot file. All three nodes
should sync with one another. And a snapshot should be taken on the node started with just a DB.
[NodeA: Permanode, NodeB: Just DB, NodeC: Just LS Files]

Scenario: PermaNode is synced
Check that the permanode has been started correctly and is synced.

#First make sure nodes are neighbored
Given "nodeA" and "nodeB" are neighbors
And "nodeA" and "nodeC" are neighbors

When we wait "30" second/seconds
Then "nodeA" is synced up to milestone 10321


Scenario: DB node is synced, and files contain expected values
Check that the node started with just a DB is synced correctly, and that the proper addresses and hashes have been
stored correctly.

#First make sure nodes are neighbored
Given "nodeB" and "nodeA" are neighbors
And "nodeB" and "nodeC" are neighbors

#Give the node time to finish syncing properly, then make sure that the node is synced to the latest milestone.
And we wait "30" second/seconds
Then "nodeB" is synced up to milestone 10321
And A local snapshot was taken on "nodeB" at index 10220

When reading the local snapshot state on "nodeB" returns with:
|keys |values |type |
|address |LS_TEST_STATE_ADDRESSES |staticValue |

And reading the local snapshot metadata on "nodeB" returns with:
|keys |values |type |
|hashes |LS_TEST_MILESTONE_HASHES |staticValue |


Scenario: LS File node is synced
Check that the node started with just LS Files is synced correctly.

#First make sure nodes are neighbored
Given "nodeC" and "nodeA" are neighbors
And "nodeC" and "nodeB" are neighbors

#Give the node time to finish syncing properly, then make sure that the node is synced to the latest milestone.
When we wait "30" second/seconds
Then "nodeC" is synced up to milestone 10321


Scenario: Check DB for milestone hashes
Give the db-less node some time to receive the latest milestones from the permanode, then check if the milestones
are present in the new node.

#First make sure nodes are neighbored
Given "nodeC" and "nodeA" are neighbors
And we wait "60" second/seconds

When "checkConsistency" is called on "nodeC" with:
|keys |values |type |
|tails |LS_TEST_MILESTONE_HASHES |staticValue |

Then the response for "checkConsistency" should return with:
|keys |values |type |
|state |True |bool |


Scenario: Old transactions are pruned
Takes a node with a large db and transaction pruning enabled, and checks to make sure that the transactions below
the pruning depth are no longer present.

Given "checkConsistency" is called on "nodeD" with:
|keys |values |type |
|tails |LS_PRUNED_TRANSACTIONS |staticValue |

Then the response for "checkConsistency" should return null
60 changes: 60 additions & 0 deletions python-regression/tests/features/machine6/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
default_args: &args
['--testnet-coordinator',
'EFPNKGPCBXXXLIBYFGIGYBYTFFPIOQVNNVVWTTIYZO9NFREQGVGDQQHUUQ9CLWAEMXVDFSSMOTGAHVIBH',
'--mwm',
'1',
'--milestone-start',
'0',
'--testnet-no-coo-validation',
'true',
'--testnet',
'true',
'--snapshot',
'./snapshot.txt',
'--local-snapshots-pruning-enabled',
'true',
'--local-snapshots-pruning-delay',
'10000'
]

default_ixi: &ixi
['IXI/LocalSnapshots.ixi']

java_options: -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n -javaagent:/opt/jacoco/lib/jacocoagent.jar=destfile=/iri/jacoco.exec,output=file,append=true,dumponexit=true

defaults: &db_full
db: https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/LS_Test_All_Files.tar
db_checksum: 4628789811b4ccbcc3cd898debff0e1b256a1cfdd636c7b5e1beb43fed461091
iri_args: *args
ixis: *ixi

db_with_snapshot: &db_with_snapshot
db: https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/LS_Test_DB_and_Snapshot.tar
db_checksum: eabb81b0570a20e8d1c65c3d29e4b4e723de537ebca0eada536e3155d5a96972
iri_args: *args
ixis: *ixi

db_with_ls_files: &db_with_LS_files
db: https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/LS_Test_LS_Files_and_Snapshot.tar
db_checksum: 87fdc9c37a6b98ec8623a5b07c49737681b7b7ac36252ab2e18cc75999f766b6
iri_args: *args
ixis: *ixi

db_for_pruning: &db_for_pruning
db: https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/PruningTestDB.tar
db_checksum: 15122ba80c0a03dc5b6b4186e5d880d0a1a15b5a6de48bafe4002c4c9b682221
iri_args: *args


nodes:
nodeA: #name
<<: *db_full

nodeB:
<<: *db_with_snapshot

nodeC:
<<: *db_with_LS_files

nodeD:
<<: *db_for_pruning
15 changes: 13 additions & 2 deletions python-regression/tests/features/steps/api_test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def api_method_is_called(step, api_call, node_name):
api = api_utils.prepare_api_call(node_name)
response = api_utils.fetch_call(api_call, api, options)

assert type(response) is dict, 'There may be something wrong with the response format: {}'.format(response)
world.responses[api_call] = {}
world.responses[api_call][node_name] = response
return response


# This method is identical to the method above, but creates a new thread
Expand Down Expand Up @@ -198,7 +198,7 @@ def make_neighbors(step, node1, node2):

for node in neighbor_candidates:
host = world.machine['nodes'][node]['podip']
port = world.machine['nodes'][node]['clusterip_ports']['gossip-udp']
port = world.machine['nodes'][node]['clusterip_ports']['gossip-tcp']
api = api_utils.prepare_api_call(node)
response = api.get_neighbors()
neighbor_info[node] = {
Expand All @@ -216,4 +216,15 @@ def make_neighbors(step, node1, node2):
neighbor_info[node2]['node_neighbors'], neighbor_info[node1]['address'])


@step(r'"([^"]+)" is synced up to milestone (\d+)')
def check_node_sync(step, node, milestone):
node_info = api_method_is_called(step, "getNodeInfo", node)
latestMilestone = node_info.get('latestMilestoneIndex')
latestSolidMilestone = node_info.get('latestSolidSubtangleMilestoneIndex')

assert latestMilestone == int(milestone), \
"Latest Milestone {} on {} is not the expected {}".format(latestMilestone, node, milestone)
assert latestSolidMilestone == int(milestone), \
"Latest Solid Milestone {} on {} is not the expected {}".format(latestSolidMilestone, node, milestone)


Loading

0 comments on commit 6e0f635

Please sign in to comment.