diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000000..268a7d1516 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,41 @@ +# !/bin/sh +# set -x +export PATH=/usr/local/bin:$PATH + STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") + ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" + +# if [[ "$STAGED_FILES" = "" ]]; then +# exit 0 +# fi + +PASS=true + +printf "\nValidating Javascript:\n" + +# Check for eslint +if [[ ! -x "$ESLINT" ]]; then + printf "\t\033[41mPlease install ESlint\033[0m (npm i --save-dev eslint)" + exit 1 +fi + +for FILE in $STAGED_FILES +do + "$ESLINT" "$(git rev-parse --show-toplevel)/$FILE" + if [[ "$?" == 0 ]]; then + printf "\t\033[32mESLint Passed: $FILE\033[0m" + else + printf "\t\033[41mESLint Failed: $FILE\033[0m" + PASS=false + fi +done + +printf "\nJavascript validation completed!\n" + +if ! $PASS; then + printf "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n" + exit 1 +else + printf "\033[42mCOMMIT SUCCEEDED\033[0m\n" +fi + +exit $? \ No newline at end of file diff --git a/.github/release-drafter-template.yml b/.github/release-drafter-template.yml new file mode 100644 index 0000000000..10aab2d148 --- /dev/null +++ b/.github/release-drafter-template.yml @@ -0,0 +1,21 @@ +name-template: 'OriginTrail Release $NEXT_PATCH_VERSION' +tag-template: "$NEXT_PATCH_VERSION" +version-template: "v$MAJOR.$MINOR.$PATCH" +categories: + - title: '🚀 Features' + labels: + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'internal process' + - title: '⚠️ Breaking changes' + labels: + - 'breaking change' +change-template: '- $TITLE (#$NUMBER)' +template: | + # Changes + + $CHANGES \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index abd87b50b0..0000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,21 +0,0 @@ -name-template: 'v$NEXT_PATCH_VERSION 🌈' -tag-template: 'v$NEXT_PATCH_VERSION' -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '🧰 Maintenance' - labels: - - 'chore' - - 'internal process' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -template: | - ## Changes - - $CHANGES \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter-config.yml similarity index 61% rename from .github/workflows/release-drafter.yml rename to .github/workflows/release-drafter-config.yml index cae6530020..00066b0c9d 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter-config.yml @@ -13,5 +13,7 @@ jobs: # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v5 with: - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # config-name: my-config.yml \ No newline at end of file + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + config-name: release-drafter-template.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 1e1ffdb575..6e6e8e554a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ env: - NODE_ENV=development ARTIFACTS_DIR=$TRAVIS_BUILD_DIR/artifacts CUCUMBER_ARTIFACTS_DIR=$ARTIFACTS_DIR/cucumber BDD_SECTION=second - NODE_ENV=development ARTIFACTS_DIR=$TRAVIS_BUILD_DIR/artifacts CUCUMBER_ARTIFACTS_DIR=$ARTIFACTS_DIR/cucumber BDD_SECTION=third - NODE_ENV=development ARTIFACTS_DIR=$TRAVIS_BUILD_DIR/artifacts CUCUMBER_ARTIFACTS_DIR=$ARTIFACTS_DIR/cucumber BDD_SECTION=fourth + - NODE_ENV=development ARTIFACTS_DIR=$TRAVIS_BUILD_DIR/artifacts CUCUMBER_ARTIFACTS_DIR=$ARTIFACTS_DIR/cucumber BDD_SECTION=fifth - NODE_ENV=development ARTIFACTS_DIR=$TRAVIS_BUILD_DIR/artifacts CUCUMBER_ARTIFACTS_DIR=$ARTIFACTS_DIR/cucumber BDD_SECTION=docker cache: @@ -41,15 +42,15 @@ script: - if [[ ("$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "fourth" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "fourth" ) ]]; then travis_wait 50 npm run test:bdd -- --tags=@fourth --world-parameters '{"appDataBaseDir":"$CUCUMBER_ARTIFACTS_DIR","keepFailedArtifacts":true}'; fi - - if [[ ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "push" && "$BDD_SECTION" == "first" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "first" ) ]]; then + - if [[ ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "fifth" ) || ( "$TRAVIS_EVENT_TYPE" == "push" && "$BDD_SECTION" == "first" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "first" ) ]]; then npm test 2> $ARTIFACTS_DIR/mocha-logs.log; fi # compile and check Smart Contracts - npm run ganache &> $ARTIFACTS_DIR/ganache.log & - - if [[ ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "push" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "second" ) ]]; then + - if [[ ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "fifth" ) || ( "$TRAVIS_EVENT_TYPE" == "push" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "second" ) ]]; then npm run truffle:test > $ARTIFACTS_DIR/truffle-test.log; fi - - if [[ ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "push" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "docker" ) || ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "docker" ) ]]; then + - if [[ ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "fifth" ) || ( "$TRAVIS_EVENT_TYPE" == "push" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "cron" && "$BDD_SECTION" == "second" ) || ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "docker" ) || ( "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "docker" ) ]]; then npm run truffle:deploy:ganache > $ARTIFACTS_DIR/truffle-migrate.log; fi - if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" && "$BDD_SECTION" == "docker" ]]; then ./test/docker/check_image.sh; fi diff --git a/config/config.json b/config/config.json index 15854331cd..564370040d 100644 --- a/config/config.json +++ b/config/config.json @@ -35,6 +35,7 @@ "dh_min_stake_amount": "100000000000", "dh_min_reputation": -50, "latest_api_version" : "v2.0", + "send_challenges_log" : true, "database": { "provider": "arangodb", "username": "root", @@ -140,6 +141,7 @@ "dh_min_stake_amount": "100000000000", "dh_min_reputation": -50, "latest_api_version" : "v2.0", + "send_challenges_log" : true, "database": { "provider": "arangodb", "username": "root", @@ -249,6 +251,7 @@ "dh_min_stake_amount": "100000000000", "dh_min_reputation": -50, "latest_api_version" : "v2.0", + "send_challenges_log" : true, "database": { "provider": "arangodb", "username": "root", diff --git a/modules/command/dc/dc-challenge-check-command.js b/modules/command/dc/dc-challenge-check-command.js index 51170e93d6..d2574067bd 100644 --- a/modules/command/dc/dc-challenge-check-command.js +++ b/modules/command/dc/dc-challenge-check-command.js @@ -39,7 +39,7 @@ class DCChallengeCheckCommand extends Command { }); if (challenge.answer === challenge.expected_answer) { - this.logger.trace('Successfully answered to challenge.'); + this.logger.trace(`Holder ${dhIdentity} successfully answered to challenge for offer ${offerId}.`); replicatedData.status = 'HOLDING'; await replicatedData.save({ fields: ['status'] }); diff --git a/modules/command/dh/dh-challenge-command.js b/modules/command/dh/dh-challenge-command.js index d4dfa0a3ab..e000ecb98b 100644 --- a/modules/command/dh/dh-challenge-command.js +++ b/modules/command/dh/dh-challenge-command.js @@ -1,5 +1,6 @@ const Command = require('../command'); const models = require('../../../models/index'); +const bugsnag = require('bugsnag'); /** * Handles one data challenge @@ -51,6 +52,23 @@ class DHChallengeCommand extends Command { ); const answer = this.challengeService.answerChallengeQuestion(blockIndex, otObject); + if (this.config.send_challenges_log) { + const bugsnagMessage = 'DH challenge answer'; + bugsnag.notify(bugsnagMessage, { + user: { + dh_node_id: this.config.identity, + dc_identity: litigatorNodeId, + challenge_id: challengeId, + data_set_id: datasetId, + object_index: objectIndex, + block_index: blockIndex, + answer, + otObject, + }, + severity: 'info', + }); + } + this.logger.info(`Calculated answer for dataset ${datasetId}, color ${color}, object index ${objectIndex}, and block index ${blockIndex} is ${answer}`); try { await this.transport.challengeResponse({ diff --git a/modules/network/kademlia/kademlia.js b/modules/network/kademlia/kademlia.js index 4c7c132d8b..24ba83b6a1 100644 --- a/modules/network/kademlia/kademlia.js +++ b/modules/network/kademlia/kademlia.js @@ -39,6 +39,7 @@ class Kademlia { kadence.constants.T_RESPONSETIMEOUT = this.config.request_timeout; kadence.constants.SOLUTION_DIFFICULTY = this.config.network.solutionDifficulty; kadence.constants.IDENTITY_DIFFICULTY = this.config.network.identityDifficulty; + kadence.constants.ALPHA = kadence.constants.K + 1; this.log.info(`Network solution difficulty ${kadence.constants.SOLUTION_DIFFICULTY}.`); this.log.info(`Network identity difficulty ${kadence.constants.IDENTITY_DIFFICULTY}.`); } @@ -226,30 +227,26 @@ class Kademlia { this._registerRoutes(); - this.node.listen(this.config.node_port, async () => { + this.node.listen(this.config.node_port, () => { this.log.notify(`OT Node listening at https://${this.node.contact.hostname}:${this.node.contact.port}`); this.kademliaUtilities.registerControlInterface(this.config, this.node); - const connected = false; - const retryPeriodSeconds = 5; - while (!connected) { - try { - // eslint-disable-next-line - const connected = await this._joinNetwork(); - if (connected) { - this.log.info('Joined to the network.'); - resolve(); - break; - } - } catch (e) { - this.log.error(`Failed to join network ${e}`); - this.notifyError(e); + async.retry({ + times: Infinity, + interval: 60000, + }, done => this.joinNetwork(done), (err, entry) => { + if (err) { + this.log.error(`Failed to join network ${err}`); + this.notifyError(err); + process.exit(1); } - this.log.trace(`Not joined to the network. Retrying in ${retryPeriodSeconds} seconds. Bootstrap nodes are probably not online.`); - // eslint-disable-next-line - await sleep.sleep(retryPeriodSeconds * 1000); - } + if (entry) { + this.log.info(`connected to network via ${entry}`); + this.log.info(`discovered ${this.node.router.size} peers from seed`); + } + resolve(); + }); }); }); } @@ -275,43 +272,41 @@ class Kademlia { * Try to join network * Note: this method tries to find possible bootstrap nodes */ - async _joinNetwork() { - return new Promise(async (accept, reject) => { - const bootstrapNodes = this.config.network.bootstraps; - utilities.shuffle(bootstrapNodes); + async joinNetwork(callback) { + let peers = Array.from(new Set(this.config.network.bootstraps + .concat(await this.node.rolodex.getBootstrapCandidates()))); + peers = utilities.shuffle(peers); + + if (peers.length === 0) { + this.log.info('no bootstrap seeds provided and no known profiles'); + this.log.info('running in seed mode (waiting for connections)'); + + callback(null, null); + + return this.node.router.events.once('add', (identity) => { + this.config.network.bootstraps = [ + kadence.utils.getContactURL([ + identity, + this.node.router.getContactByNodeId(identity), + ]), + ]; + this.joinNetwork(callback); + }); + } - if (this.config.is_bootstrap_node) { - this.log.info(`Found ${bootstrapNodes.length} provided bootstrap node(s). Running as a Bootstrap node`); + this.log.info(`joining network from ${peers.length} seeds`); + async.detectSeries(peers, (url, done) => { + const contact = kadence.utils.parseContactURL(url); + this.node.join(contact, (err) => { + done(null, (!err) && this.node.router.size > 0); + }); + }, (err, result) => { + if (!result) { + this.log.error('failed to join network, will retry in 1 minute'); + callback(new Error('Failed to join network')); } else { - this.log.info(`Found ${bootstrapNodes.length} provided bootstrap node(s)`); + callback(null, result); } - - this.log.info(`Sync with network from ${bootstrapNodes.length} unique peers`); - if (bootstrapNodes.length === 0) { - this.log.info('No bootstrap seeds provided and no known profiles'); - this.log.info('Running in seed mode (waiting for connections)'); - accept(true); - return; - } - - let connected = false; - const promises = bootstrapNodes.map(address => new Promise((acc, rej) => { - const contact = kadence.utils.parseContactURL(address); - this.log.debug(`Joining ${address}`); - this.node.join(contact, (err) => { - if (err) { - this.log.warn(`Failed to join ${address}`); - acc(false); - return; - } - this.log.trace(`Finished joining to ${address}`); - connected = this._isConnected(); - acc(true); - }); - })); - - await Promise.all(promises); - accept(connected); }); } diff --git a/package-lock.json b/package-lock.json index 70e784a6e1..1a465acf67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "4.0.5", + "version": "4.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -203,7 +203,7 @@ "requires": { "7zip": "0.0.6", "async": "2.6.1", - "latest-torbrowser-version": "2.0.2", + "latest-torbrowser-version": "2.0.3", "merge": "1.2.1", "mkdirp": "0.5.1", "mv": "2.1.1", @@ -258,14 +258,14 @@ } }, "@deadcanaries/kadence": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@deadcanaries/kadence/-/kadence-6.1.8.tgz", - "integrity": "sha512-T4FXLQm+t+m6zJBv6QfNyD07ArdTaCiRDut/Qsqw+jFZmFjBMeVdNEDiAjNqmC+Gb0TKhSGTvs/D5kATTTyL5A==", + "version": "6.1.9", + "resolved": "https://registry.npmjs.org/@deadcanaries/kadence/-/kadence-6.1.9.tgz", + "integrity": "sha512-7Zt7tW+brq97MsxC3Dw+/qFDn9Vp2lxiQ+5nEkZ02UraNnzrsAv0Mch3b0FKO5DnbU2aKjpv+4XX5V/4nMO4/A==", "requires": { "@deadcanaries/diglet": "2.0.6", "@deadcanaries/hsv3": "1.1.6", "async": "2.6.1", - "atbf": "1.1.0", + "atbf": "1.1.1", "boscar": "2.0.0", "bunyan": "1.8.12", "bunyan-rotating-file-stream": "1.6.3", @@ -283,14 +283,14 @@ "levelup": "4.3.2", "lru-cache": "4.1.1", "merge": "1.2.1", - "metapipe": "2.0.2", + "metapipe": "2.0.3", "mkdirp": "0.5.1", "ms": "2.1.1", "nat-pmp": "git+https://gitlab.com/deadcanaries/depends/node-nat-pmp#7029e2b0ab11073df0d71b6d9da4a2aefeb5723d", "nat-upnp": "1.1.1", "network": "0.4.1", "npid": "0.4.0", - "pem": "1.14.3", + "pem": "1.14.4", "rc": "1.2.8", "secp256k1": "3.2.2", "semver": "5.6.0", @@ -320,6 +320,13 @@ "level-errors": "2.0.1" } }, + "equihash": { + "version": "github:digitalbazaar/equihash#f14491f6bbe6e84904b1d6966b55bcba8fe5b564", + "requires": { + "bindings": "1.3.0", + "nan": "2.10.0" + } + }, "level-codec": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", @@ -339,7 +346,7 @@ "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", "requires": { "inherits": "2.0.4", - "readable-stream": "3.4.0", + "readable-stream": "3.5.0", "xtend": "4.0.2" }, "dependencies": { @@ -374,6 +381,11 @@ "requires": { "xtend": "4.0.1" } + }, + "nan": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" } } }, @@ -389,32 +401,21 @@ "xtend": "4.0.1" } }, - "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" - }, - "nat-pmp": { - "version": "git+https://gitlab.com/deadcanaries/depends/node-nat-pmp#7029e2b0ab11073df0d71b6d9da4a2aefeb5723d", - "requires": { - "debug": "2.6.9" - } - }, "pem": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/pem/-/pem-1.14.3.tgz", - "integrity": "sha512-Q+AMVMD3fzeVvZs5PHeI+pVt0hgZY2fjhkliBW43qyONLgCXPVk1ryim43F9eupHlNGLJNT5T/NNrzhUdiC5Zg==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/pem/-/pem-1.14.4.tgz", + "integrity": "sha512-v8lH3NpirgiEmbOqhx0vwQTxwi0ExsiWBGYh0jYNq7K6mQuO4gI6UEFlr6fLAdv9TPXRt6GqiwE37puQdIDS8g==", "requires": { "es6-promisify": "6.0.2", "md5": "2.2.1", "os-tmpdir": "1.0.2", - "which": "1.3.1" + "which": "2.0.2" } }, "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", + "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", "requires": { "inherits": "2.0.3", "string_decoder": "1.1.1", @@ -432,7 +433,7 @@ "create-hash": "1.2.0", "drbg.js": "1.0.1", "elliptic": "6.4.0", - "nan": "2.12.1" + "nan": "2.10.0" } }, "socks": { @@ -443,6 +444,14 @@ "ip": "1.1.5", "smart-buffer": "1.1.15" } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "2.0.0" + } } } }, @@ -516,9 +525,9 @@ } }, "adm-zip": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.13.tgz", - "integrity": "sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw==" + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.14.tgz", + "integrity": "sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==" }, "aes-js": { "version": "3.1.1", @@ -997,9 +1006,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atbf": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/atbf/-/atbf-1.1.0.tgz", - "integrity": "sha1-iD2Esib2FHUwDTm5almiFH3sMuE=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/atbf/-/atbf-1.1.1.tgz", + "integrity": "sha512-NtFI3g9nKmKFtmlzingqzZ5kh5yXjdOU7JfFdhc6Ec0tuhe5tTNUkvuaEn72AOJ52yhpmyzHhtUC3EiI5jHlug==", "requires": { "bloem": "0.2.4" } @@ -1012,7 +1021,7 @@ "auto-updater": { "version": "git+https://github.com/OriginTrail/auto-updater.git#6903977fd8e51c0a1f0d226e8208375426a03f39", "requires": { - "adm-zip": "0.4.13", + "adm-zip": "0.4.14", "node-promise": "0.5.14", "rimraf": "2.6.2", "underscore": "1.9.1" @@ -3970,13 +3979,6 @@ "typechecker": "4.5.0" } }, - "equihash": { - "version": "github:digitalbazaar/equihash#f14491f6bbe6e84904b1d6966b55bcba8fe5b564", - "requires": { - "bindings": "1.3.0", - "nan": "2.10.0" - } - }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -11502,13 +11504,13 @@ "domutils": "1.5.1", "entities": "1.1.2", "inherits": "2.0.3", - "readable-stream": "3.4.0" + "readable-stream": "3.5.0" }, "dependencies": { "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", + "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", "requires": { "inherits": "2.0.3", "string_decoder": "1.1.1", @@ -12322,9 +12324,9 @@ } }, "latest-torbrowser-version": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/latest-torbrowser-version/-/latest-torbrowser-version-2.0.2.tgz", - "integrity": "sha512-2cg5j8szOY0g3jlyLZhye9as3oJihNJD3DN9+I7tdXMEBW4ZKH8Blq17xtj5Q2jtV7v8NjRCkBrXz3zPEjMWLQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/latest-torbrowser-version/-/latest-torbrowser-version-2.0.3.tgz", + "integrity": "sha512-+6fkERFLxo2QiNn7x0txjEF199tG4CGVI9X101d7IuZAapO/hGOC+nHD9BEPNNaMqmvIUkT/o3CdZ+NS5wX/iQ==", "requires": { "async": "2.6.1", "cheerio": "1.0.0-rc.3", @@ -13298,9 +13300,9 @@ } }, "metapipe": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/metapipe/-/metapipe-2.0.2.tgz", - "integrity": "sha512-BLQ+3J2OTMXWFLyoav/sl1sPIpDt3EaJSDpov1gitKoYl8uWfkXPOUplYJip/DWIaKd45LdsOuOR0k1jjDaacg==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/metapipe/-/metapipe-2.0.3.tgz", + "integrity": "sha512-WeylW3ANIw88AeAqfYCPWoeHWfVWpAd5hk/CZEdni4diFq/M40ioXomJH1yqEK0yWsuZDcFnV5LfyZicryPlzw==" }, "micromatch": { "version": "3.1.10", @@ -13626,6 +13628,12 @@ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==" }, + "nat-pmp": { + "version": "git+https://gitlab.com/deadcanaries/depends/node-nat-pmp#7029e2b0ab11073df0d71b6d9da4a2aefeb5723d", + "requires": { + "debug": "2.6.9" + } + }, "nat-upnp": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/nat-upnp/-/nat-upnp-1.1.1.tgz", @@ -19914,7 +19922,7 @@ "minimist": "1.2.0", "mkdirp": "0.5.1", "napi-build-utils": "1.0.1", - "node-abi": "2.13.0", + "node-abi": "2.14.0", "noop-logger": "0.1.1", "npmlog": "4.1.2", "os-homedir": "1.0.2", @@ -19932,9 +19940,9 @@ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" }, "node-abi": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.13.0.tgz", - "integrity": "sha512-9HrZGFVTR5SOu3PZAnAY2hLO36aW1wmA+FDsVkr85BTST32TLCA1H/AEcatVRAsWLyXS3bqUDYCAjq5/QGuSTA==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.14.0.tgz", + "integrity": "sha512-y54KGgEOHnRHlGQi7E5UiryRkH8bmksmQLj/9iLAjoje743YS+KaKB/sDYXgqtT0J16JT3c3AYJZNI98aU/kYg==", "requires": { "semver": "5.6.0" } @@ -24594,14 +24602,14 @@ "resolved": "https://registry.npmjs.org/wmic/-/wmic-0.1.0.tgz", "integrity": "sha1-eLQasR0VTLgSgZ4SkWdNrVXY4dc=", "requires": { - "async": "3.1.0", + "async": "3.1.1", "iconv-lite": "0.4.23" }, "dependencies": { "async": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", - "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/async/-/async-3.1.1.tgz", + "integrity": "sha512-X5Dj8hK1pJNC2Wzo2Rcp9FBVdJMGRR/S7V+lH46s8GVFhtbo5O4Le5GECCF/8PISVdkUA6mMPvgz7qTTD1rf1g==" } } }, diff --git a/package.json b/package.json index 15c2eadab6..5f17a17b83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "4.0.5", + "version": "4.0.6", "description": "OriginTrail node", "main": ".eslintrc.js", "config": { @@ -80,7 +80,7 @@ "homepage": "https://origintrail.io", "snyk": true, "dependencies": { - "@deadcanaries/kadence": "^6.1.6", + "@deadcanaries/kadence": "^6.1.9", "@garbados/merkle-tree": "^1.0.3-alpha", "ajv": "^5.5.2", "arangojs": "^5.8.0", diff --git a/test/bdd/features/datalayer.feature b/test/bdd/features/datalayer.feature index 11bb72bb41..e8c421fcbf 100644 --- a/test/bdd/features/datalayer.feature +++ b/test/bdd/features/datalayer.feature @@ -187,6 +187,10 @@ Feature: Data layer related features @first Scenario: Challenge request-response test Given I setup 4 nodes + And I override configuration for all nodes + | dc_holding_time_in_minutes | 5 | + | numberOfChallenges | 100 | + | challengeResponseTimeMills | 5000 | And I start the nodes And I use 1st node as DC And I use 3th node as DH diff --git a/test/bdd/features/litigation.feature b/test/bdd/features/litigation.feature index 18852798f4..e2558a14e1 100644 --- a/test/bdd/features/litigation.feature +++ b/test/bdd/features/litigation.feature @@ -92,7 +92,7 @@ Feature: Test various litigation scenarios And I setup 4 nodes When I override configuration for all nodes | dc_holding_time_in_minutes | 5 | - | numberOfChallenges | 1 | + | numberOfChallenges | 100 | | challengeResponseTimeMills | 5000 | And I start the nodes And I use 1st node as DC @@ -113,7 +113,7 @@ Feature: Test various litigation scenarios And I setup 5 nodes And I override configuration for all nodes | dc_holding_time_in_minutes | 10 | - | numberOfChallenges | 10 | + | numberOfChallenges | 100 | | challengeResponseTimeMills | 5000 | | dh_min_reputation | 0 | And I start the nodes diff --git a/test/modules/utilities.test.js b/test/modules/utilities.test.js index 1206af47da..5f23c48c52 100644 --- a/test/modules/utilities.test.js +++ b/test/modules/utilities.test.js @@ -28,7 +28,7 @@ describe('Utilities module', () => { 'autoUpdater', 'bugSnag', 'network', 'dataSetStorage', 'dc_holding_time_in_minutes', 'dc_choose_time', 'dc_litigation_interval_in_minutes', 'dh_max_holding_time_in_minutes', 'dh_min_litigation_interval_in_minutes', 'erc725_identity_filepath', 'requireApproval', 'dh_maximum_dataset_filesize_in_mb', 'latest_api_version', 'litigationEnabled', 'commandExecutorVerboseLoggingEnabled', - 'reputationWindowInMinutes'], + 'reputationWindowInMinutes', 'send_challenges_log'], `Some config items are missing in config for environment '${environment}'`, ); assert.hasAllKeys(