Skip to content

Commit

Permalink
Merge pull request #1208 from OriginTrail/prerelease/mainnet
Browse files Browse the repository at this point in the history
OriginTrail Release v4.0.8
  • Loading branch information
Kuki145 authored Mar 12, 2020
2 parents 685d9fe + 8702fc2 commit 6cbe337
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 176 deletions.
10 changes: 6 additions & 4 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"cooldownBaseTimeout": "5m",
"cooldownMultiplier": 2,
"cooldownResetTime": "1s"
}
},
"bucket_size": 4
},
"bugSnag": {
"releaseStage": "development"
Expand Down Expand Up @@ -180,7 +181,6 @@
"hostname": "127.0.0.1",
"id": "TestnetV4.0",
"bootstraps": [
"https://rinkeby-mariner-bootstrap-01.origin-trail.network:5278/#f4092d1795e2fd442308911db2c1df31faf4fe2f",
"https://rinkeby-mariner-bootstrap-02.origin-trail.network:5278/#d3951837f8100e6ea4a74417d560bcc8c6d4ffe5",
"https://rinkeby-mariner-bootstrap-03.origin-trail.network:5278/#ad3c3325e50c3bedcb5c6ee6a73592b2ca7e07aa"
],
Expand All @@ -191,7 +191,8 @@
"cooldownBaseTimeout": "5m",
"cooldownMultiplier": 2,
"cooldownResetTime": "1s"
}
},
"bucket_size": 4
},
"bugSnag": {
"releaseStage": "testnet"
Expand Down Expand Up @@ -303,7 +304,8 @@
"cooldownBaseTimeout": "5m",
"cooldownMultiplier": 2,
"cooldownResetTime": "1s"
}
},
"bucket_size": 20
},
"bugSnag": {
"releaseStage": "mainnet"
Expand Down
17 changes: 9 additions & 8 deletions modules/EventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,8 @@ class EventEmitter {
this._on('kad-replication-request', async (request, response) => {
const message = transport.extractMessage(request);
const { offerId, wallet, dhIdentity } = message;
const { wallet: senderWallet } = transport.extractSenderInfo(request);
const identity = transport.extractSenderID(request);

if (senderWallet !== wallet) {
logger.warn(`Wallet in the message differs from replication request for offer ID ${offerId}.`);
}

try {
await dcService.handleReplicationRequest(
offerId, wallet, identity, dhIdentity,
Expand Down Expand Up @@ -668,11 +663,17 @@ class EventEmitter {
try {
const dhNodeId = transport.extractSenderID(request);
const replicationFinishedMessage = transport.extractMessage(request);
const { wallet } = transport.extractSenderInfo(request);
const { offerId, messageSignature, dhIdentity } = replicationFinishedMessage;
const {
offerId, messageSignature, dhIdentity,
} = replicationFinishedMessage;

let dhWallet = replicationFinishedMessage.wallet;
if (!dhWallet) {
dhWallet = transport.extractSenderInfo(request).wallet;
}
await dcService.verifyDHReplication(
offerId, messageSignature,
dhNodeId, dhIdentity, wallet, false,
dhNodeId, dhIdentity, dhWallet, false,
);
} catch (e) {
const errorMessage = `Failed to handle replication finished request. ${e}.`;
Expand Down
1 change: 0 additions & 1 deletion modules/command/dc/dc-challenge-check-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class DCChallengeCheckCommand extends Command {
severity: 'info',
});


this.logger.info(`Wrong answer to challenge '${challenge.id}' for DH ID ${challenge.dh_id}. Got ${challenge.answer} for expected answer ${challenge.expected_answer}.`);
return {
commands: [
Expand Down
1 change: 1 addition & 0 deletions modules/command/dh/dh-replication-import-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class DhReplicationImportCommand extends Command {
offerId,
dhIdentity: this.config.erc725Identity,
messageSignature: messageSignature.signature,
wallet: this.config.node_wallet,
};

await this.transport.replicationFinished(replicationFinishedMessage, dcNodeId);
Expand Down
2 changes: 1 addition & 1 deletion modules/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.DEFAULT_CHALLENGE_BLOCK_SIZE_BYTES = 31;
/**
* @constant {number} DEFAULT_CHALLENGE_RESPONSE_TIME_MILLS - Challenge response time
*/
exports.DEFAULT_CHALLENGE_RESPONSE_TIME_MILLS = 60000;
exports.DEFAULT_CHALLENGE_RESPONSE_TIME_MILLS = 300000;

/**
* @constant {number} DEFAULT_REPUTATION_UPDATE_PERIOD_MILLS - Period for updating reputation table
Expand Down
Loading

0 comments on commit 6cbe337

Please sign in to comment.