From 30dae84c704b7717292213a714568efbee4c98f9 Mon Sep 17 00:00:00 2001 From: Kasun Kavinda Date: Fri, 13 Jan 2023 12:43:24 +0530 Subject: [PATCH 1/2] Send Heartbeat invokes in a distributed manner. (#225) --- mb-xrpl/lib/message-board.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mb-xrpl/lib/message-board.js b/mb-xrpl/lib/message-board.js index 47d5314..5fc4e92 100644 --- a/mb-xrpl/lib/message-board.js +++ b/mb-xrpl/lib/message-board.js @@ -333,21 +333,26 @@ class MessageBoard { async #startHeartBeatScheduler() { // Sending a heartbeat at startup await this.#sendHeartbeat(); - - const timeout = this.hostClient.config.momentSize * 1000; // Seconds to millisecs. - + + const momentSize = this.hostClient.config.momentSize; + const halfMomentSize = momentSize / 2; // Getting half of moment size + const timeout = momentSize * 1000; // Converting seconds to milliseconds. + const scheduler = async () => { setTimeout(async () => { await scheduler(); }, timeout); await this.#sendHeartbeat(); }; - - const nextMomentStartIdx = await this.hostClient.getMomentStartIndex() + this.hostClient.config.momentSize; + + const currentMomentStartIdx = await this.hostClient.getMomentStartIndex(); + + // If the start index is in the begining of the moment, delay the heartbeat scheduler 1 minute to make sure the hook timestamp is not in previous moment when accepting the heartbeat. + const startTimeout = (evernode.UtilHelpers.getCurrentUnixTime() - currentMomentStartIdx) < halfMomentSize ? ((momentSize + 60) * 1000) : ((momentSize) * 1000); + setTimeout(async () => { await scheduler(); - }, (nextMomentStartIdx - evernode.UtilHelpers.getCurrentUnixTime() + 60) * 1000); - // Delay the heartbeat scheduler 1 minute to make sure the hook timestamp is not in previous moment when accepting the heartbeat. + }, startTimeout); } // Try to acquire the lease update lock. From adf0ef77b5a3a6e2fa4b947a188941a47b103ca3 Mon Sep 17 00:00:00 2001 From: Chalith Desaman Date: Thu, 6 Apr 2023 12:53:43 +0530 Subject: [PATCH 2/2] Added identification texts for V network (#247) --- installer/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/setup.sh b/installer/setup.sh index 3861982..235cc41 100755 --- a/installer/setup.sh +++ b/installer/setup.sh @@ -6,7 +6,7 @@ # surrounding braces are needed make the whole script to be buffered on client before execution. { -evernode="Evernode beta" +evernode="Evernode Beta v2" maxmind_creds="687058:FtcQjM0emHFMEfgI" cgrulesengd_default="cgrulesengd" alloc_ratio=80 @@ -639,7 +639,7 @@ function install_evernode() { # Currently the domain address saved only in account_info and an empty value in Hook states ) description="" - echo "Installing Sashimono..." + echo "Installing Sashimono on Evernode Beta V2 (Disabled Network)..." # Filter logs with STAGE prefix and ommit the prefix when echoing. # If STAGE log contains -p arg, move the cursor to previous log line and overwrite the log. ! UPGRADE=$upgrade ./sashimono-install.sh $inetaddr $init_peer_port $init_user_port $countrycode $alloc_instcount \