Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
timothe
duniter
Commits
3df56aaf
Commit
3df56aaf
authored
Dec 15, 2019
by
Éloïs
Committed by
Cédric Moreau
Jan 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ref] rename BLOCK_NEW_GENERATED_VERSION -> DUBP_NEXT_VERSION
parent
64db2c5b
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
27 additions
and
26 deletions
+27
-26
app/lib/common-libs/constants.ts
app/lib/common-libs/constants.ts
+2
-1
app/lib/rules/local_rules.ts
app/lib/rules/local_rules.ts
+1
-1
app/modules/prover/lib/blockProver.ts
app/modules/prover/lib/blockProver.ts
+1
-1
test/integration/branches/branches_revert2.ts
test/integration/branches/branches_revert2.ts
+2
-2
test/integration/certification/certification-expiry.ts
test/integration/certification/certification-expiry.ts
+2
-2
test/integration/certification/certification-replay.ts
test/integration/certification/certification-replay.ts
+2
-2
test/integration/fork-resolution/register-fork-blocks.ts
test/integration/fork-resolution/register-fork-blocks.ts
+2
-2
test/integration/membership_chainability.ts
test/integration/membership_chainability.ts
+5
-5
test/integration/sandbox/expired-certifications.ts
test/integration/sandbox/expired-certifications.ts
+2
-2
test/integration/sandbox/expired-identity.ts
test/integration/sandbox/expired-identity.ts
+2
-2
test/integration/sandbox/expired-membership.ts
test/integration/sandbox/expired-membership.ts
+2
-2
test/integration/sandbox/expired-transactions.ts
test/integration/sandbox/expired-transactions.ts
+2
-2
test/integration/wot/wotb.ts
test/integration/wot/wotb.ts
+2
-2
No files found.
app/lib/common-libs/constants.ts
View file @
3df56aaf
...
...
@@ -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
,
...
...
app/lib/rules/local_rules.ts
View file @
3df56aaf
...
...
@@ -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
...
...
app/modules/prover/lib/blockProver.ts
View file @
3df56aaf
...
...
@@ -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
()
=>
{
...
...
test/integration/branches/branches_revert2.ts
View file @
3df56aaf
...
...
@@ -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
})
});
test/integration/certification/certification-expiry.ts
View file @
3df56aaf
...
...
@@ -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
})
}))
test/integration/certification/certification-replay.ts
View file @
3df56aaf
...
...
@@ -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
})
}))
test/integration/fork-resolution/register-fork-blocks.ts
View file @
3df56aaf
...
...
@@ -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
})
})
test/integration/membership_chainability.ts
View file @
3df56aaf
...
...
@@ -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
()
=>
{
...
...
test/integration/sandbox/expired-certifications.ts
View file @
3df56aaf
...
...
@@ -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
})
}))
test/integration/sandbox/expired-identity.ts
View file @
3df56aaf
...
...
@@ -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
})
}))
test/integration/sandbox/expired-membership.ts
View file @
3df56aaf
...
...
@@ -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
})
}))
test/integration/sandbox/expired-transactions.ts
View file @
3df56aaf
...
...
@@ -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
})
}))
test/integration/wot/wotb.ts
View file @
3df56aaf
...
...
@@ -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
})
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment