diff --git a/app/lib/common-libs/constants.ts b/app/lib/common-libs/constants.ts index cf5224b66ae5f8e20cab28f932e135bd368a31ef..e14647b65e5b93c7a62158b493394280c2f63ed3 100755 --- a/app/lib/common-libs/constants.ts +++ b/app/lib/common-libs/constants.ts @@ -103,7 +103,8 @@ export const CommonConstants = { // Version of genesis block BLOCK_GENESIS_VERSION: 10, - BLOCK_NEW_GENERATED_VERSION: 11, // Put it to 11 when ready + // Highest supported version of DUBP protocol (= next version of the protocol) + DUBP_NEXT_VERSION: 11, 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 81a536cbcfee126a3cb7d071fc80d0fe1251eca6..87bcfa9fbc5c7cdecb5060d78c232c15caab407a 100644 --- a/app/lib/rules/local_rules.ts +++ b/app/lib/rules/local_rules.ts @@ -540,7 +540,7 @@ export const LOCAL_RULES_HELPERS = { // More than 70% of the computing network converted? Let's go to next version. if (Math.floor(nbNoncesWithNextVersionCode / uniqIssuersInFrame.length) > 0.6) { - return constants.BLOCK_NEW_GENERATED_VERSION + return constants.DUBP_NEXT_VERSION } // Otherwise, we stay on same version diff --git a/app/modules/prover/lib/blockProver.ts b/app/modules/prover/lib/blockProver.ts index 9bcdfe74901e2240acc0b183b340b7736eaf00aa..63e8271f7d3669133b8b41f63bed1056d8b22d38 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.BLOCK_NEW_GENERATED_VERSION === 11 + const notifyVersionJumpReady = block.version === 10 && CommonConstants.DUBP_NEXT_VERSION === 11 return (async () => { diff --git a/test/integration/branches/branches_revert2.ts b/test/integration/branches/branches_revert2.ts index 78748f5e75eeedd5bddbc7036954b9ef1d3f2199..e1f1010b8256da2a61ab7a627826c5ac2eb129de 100644 --- a/test/integration/branches/branches_revert2.ts +++ b/test/integration/branches/branches_revert2.ts @@ -43,7 +43,7 @@ describe("Revert two blocks", function() { before(async () => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 s1 = NewTestingServer( Underscore.extend({ @@ -291,6 +291,6 @@ describe("Revert two blocks", function() { }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) }); diff --git a/test/integration/certification/certification-expiry.ts b/test/integration/certification/certification-expiry.ts index 0ea21e8069dbc29ff57df93a1355eb3a4422bad8..3c24878b4b8308177d0e63fd146882d97613022c 100644 --- a/test/integration/certification/certification-expiry.ts +++ b/test/integration/certification/certification-expiry.ts @@ -21,7 +21,7 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User }, (test) => { before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) const now = 1500000000 @@ -109,6 +109,6 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) })) diff --git a/test/integration/certification/certification-replay.ts b/test/integration/certification/certification-replay.ts index 88ddce86fe94b0ae3a20bda300ecf305a19e41b5..f67a69358ddbc6d274dd8123ff8a97a16060690a 100644 --- a/test/integration/certification/certification-replay.ts +++ b/test/integration/certification/certification-replay.ts @@ -23,7 +23,7 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({ }, (test) => { before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) const now = 1500000000 @@ -126,6 +126,6 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({ }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) })) diff --git a/test/integration/fork-resolution/register-fork-blocks.ts b/test/integration/fork-resolution/register-fork-blocks.ts index f74d1d9c10a5f00faafc3e8a8a4c423896759253..41af692002dabe895daf05eda79be56a15f66f05 100644 --- a/test/integration/fork-resolution/register-fork-blocks.ts +++ b/test/integration/fork-resolution/register-fork-blocks.ts @@ -28,7 +28,7 @@ describe("Fork blocks", function() { before(async () => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 s1 = NewTestingServer({ @@ -235,6 +235,6 @@ describe("Fork blocks", function() { }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) }) diff --git a/test/integration/membership_chainability.ts b/test/integration/membership_chainability.ts index 458f30349d4305c079e34e1a56ca9868091a6c46..bf93672302c7cc8b62160dc37db536341e74eeea 100644 --- a/test/integration/membership_chainability.ts +++ b/test/integration/membership_chainability.ts @@ -35,18 +35,18 @@ describe("Membership chainability", function() { const res1 = await simpleNodeWith2Users(conf) s1 = res1.s1 cat = res1.cat - const nowVersion = CommonConstants.BLOCK_NEW_GENERATED_VERSION - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + const nowVersion = CommonConstants.DUBP_NEXT_VERSION + CommonConstants.DUBP_NEXT_VERSION = 10 await s1.commit({ time: now }) await s1.commit({ time: now }) await s1.commit({ time: now, actives: [ 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd:rppB5NEwmdMUCxw3N/QPMk+V1h2Jpn0yxTzdO2xxcNN3MACv6x8vNTChWwM6DOq+kXiQHTczFzoux+82WkMfDQ==:1-12D7B9BEBE941F6929A4A61CDC06DEEEFCB00FD1DA72E42FFF7B19A338D421E1:0-E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855:cat' ]}) - CommonConstants.BLOCK_NEW_GENERATED_VERSION = nowVersion + CommonConstants.DUBP_NEXT_VERSION = nowVersion }) before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) it('current should be the 2nd', () => s1.expect('/blockchain/current', (res:any) => { @@ -55,7 +55,7 @@ describe("Membership chainability", function() { })) before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) after(async () => { diff --git a/test/integration/sandbox/expired-certifications.ts b/test/integration/sandbox/expired-certifications.ts index e3af0d5f5925bbfe8673db830a5f3b3147bbb075..5697fefacfb7c7b6eb399e2c1ae494c6f7c80203 100644 --- a/test/integration/sandbox/expired-certifications.ts +++ b/test/integration/sandbox/expired-certifications.ts @@ -24,7 +24,7 @@ describe('Expired certifications', () => writeBasicTestWithConfAnd2Users({ }, (test) => { before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) const now = 1500000000 @@ -58,6 +58,6 @@ describe('Expired certifications', () => writeBasicTestWithConfAnd2Users({ }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) })) diff --git a/test/integration/sandbox/expired-identity.ts b/test/integration/sandbox/expired-identity.ts index 5d8af970213a677a3dfd133bdaf5e7bfdb36b5b9..9f0990bfc3421f2bd020771802c6286a957d8eae 100644 --- a/test/integration/sandbox/expired-identity.ts +++ b/test/integration/sandbox/expired-identity.ts @@ -23,7 +23,7 @@ describe('Expired identities', () => writeBasicTestWithConfAnd2Users({ }, (test) => { before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) const now = 1500000000 @@ -47,6 +47,6 @@ describe('Expired identities', () => writeBasicTestWithConfAnd2Users({ }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) })) diff --git a/test/integration/sandbox/expired-membership.ts b/test/integration/sandbox/expired-membership.ts index b98ebe3ab1517f805aa27881ea2aefa329581a00..d71a74011053c7f85ddecd34931076ad3aa830a4 100644 --- a/test/integration/sandbox/expired-membership.ts +++ b/test/integration/sandbox/expired-membership.ts @@ -23,7 +23,7 @@ describe('Expired membership', () => writeBasicTestWithConfAnd2Users({ }, (test) => { before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 }) const now = 1500000000 @@ -58,6 +58,6 @@ describe('Expired membership', () => writeBasicTestWithConfAnd2Users({ }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) })) diff --git a/test/integration/sandbox/expired-transactions.ts b/test/integration/sandbox/expired-transactions.ts index fe950d99b375696770b013d6a3cd358e301f9688..2c8cc49bdc4d80e7cdc18be984dff810fa18a831 100644 --- a/test/integration/sandbox/expired-transactions.ts +++ b/test/integration/sandbox/expired-transactions.ts @@ -22,7 +22,7 @@ describe('Expired transactions', () => writeBasicTestWithConfAnd2Users({ let oldTxWindowValue: number before(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 oldTxWindowValue = CommonConstants.TX_WINDOW CommonConstants.TX_WINDOW = 2 // We need a low value to pass time bounds rules }) @@ -48,7 +48,7 @@ describe('Expired transactions', () => writeBasicTestWithConfAnd2Users({ }) after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 CommonConstants.TX_WINDOW = oldTxWindowValue }) })) diff --git a/test/integration/wot/wotb.ts b/test/integration/wot/wotb.ts index b9acfcb24873c5d2f2fcf35c33d0862606ce8ab5..e72ed7cfcfe5053fe967acee993856b97ec03398 100644 --- a/test/integration/wot/wotb.ts +++ b/test/integration/wot/wotb.ts @@ -59,7 +59,7 @@ describe("WOTB module", () => { before(async () => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 11 + CommonConstants.DUBP_NEXT_VERSION = 11 s1 = NewTestingServer( Underscore.extend({ @@ -452,7 +452,7 @@ describe("WOTB module", () => { }); after(() => { - CommonConstants.BLOCK_NEW_GENERATED_VERSION = 10 + CommonConstants.DUBP_NEXT_VERSION = 10 }) }); });