diff --git a/app/lib/common-libs/constants.ts b/app/lib/common-libs/constants.ts index e14647b65e5b93c7a62158b493394280c2f63ed3..13d8ed290c36cd382b40354f6ac057e8d9b141ce 100755 --- a/app/lib/common-libs/constants.ts +++ b/app/lib/common-libs/constants.ts @@ -20,7 +20,7 @@ const SIGNATURE = "[A-Za-z0-9+\\/=]{87,88}" const USER_ID = "[A-Za-z0-9_-]{2,100}" const INTEGER = "(0|[1-9]\\d{0,18})" const FINGERPRINT = "[A-F0-9]{64}" -const BLOCK_VERSION = "(10|11)" +const BLOCK_VERSION = "(10|11|12)" const TX_VERSION = "(10)" const DIVIDEND = "[1-9][0-9]{0,5}" const ZERO_OR_POSITIVE_INT = "0|[1-9][0-9]{0,18}" @@ -104,7 +104,7 @@ export const CommonConstants = { // Version of genesis block BLOCK_GENESIS_VERSION: 10, // Highest supported version of DUBP protocol (= next version of the protocol) - DUBP_NEXT_VERSION: 11, + DUBP_NEXT_VERSION: 12, LAST_VERSION_FOR_TX: 10, TRANSACTION_VERSION: 10, DOCUMENTS_VERSION: 10, diff --git a/app/lib/rules/local_rules.ts b/app/lib/rules/local_rules.ts index c943fac63f8cba8718f20a22d92a936e71cfcaea..ad297305314e69a7c8d09ad1f3f3d913e5d67eaf 100644 --- a/app/lib/rules/local_rules.ts +++ b/app/lib/rules/local_rules.ts @@ -544,7 +544,8 @@ export const LOCAL_RULES_HELPERS = { const nbNoncesWithNextVersionCode = lastNonceOfEachIssuer.filter(nonce => nonce.substr(-11, 3) === '999').length // More than 70% of the computing network converted? Let's go to next version. - if (Math.floor(nbNoncesWithNextVersionCode / uniqIssuersInFrame.length) > 0.6) { + let propIssuersReadyToJump = nbNoncesWithNextVersionCode / uniqIssuersInFrame.length; + if (propIssuersReadyToJump > 0.7) { return constants.DUBP_NEXT_VERSION } diff --git a/app/modules/prover/lib/blockProver.ts b/app/modules/prover/lib/blockProver.ts index 63e8271f7d3669133b8b41f63bed1056d8b22d38..9b3b3953012d311179393d4cbccb1831229d9f45 100644 --- a/app/modules/prover/lib/blockProver.ts +++ b/app/modules/prover/lib/blockProver.ts @@ -163,7 +163,7 @@ export class BlockProver { const remainder = difficulty % 16; const nbZeros = (difficulty - remainder) / 16; const highMark = CommonConstants.PROOF_OF_WORK.UPPER_BOUND[remainder]; - const notifyVersionJumpReady = block.version === 10 && CommonConstants.DUBP_NEXT_VERSION === 11 + const notifyVersionJumpReady: boolean = (block.version + 1) === CommonConstants.DUBP_NEXT_VERSION; return (async () => {