Skip to content

Commit 79267b8

Browse files
authored
chore: add Core v0.18 quorums (#247)
1 parent f7d20fa commit 79267b8

File tree

3 files changed

+53
-8
lines changed

3 files changed

+53
-8
lines changed

lib/constants/index.js

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,47 @@ module.exports = {
4040
// In duffs
4141
INSTANTSEND_FEE_PER_INPUT: 10000,
4242
LLMQ_TYPES: {
43-
LLMQ_TYPE_50_60: 1,
4443
// 50 members, 30 (60%) threshold, one per hour (24 blocks)
45-
LLMQ_TYPE_400_60: 2,
44+
LLMQ_TYPE_50_60: 1,
45+
4646
// 400 members, 240 (60%) threshold, one every 12 hours (288 blocks)
47-
LLMQ_TYPE_400_85: 3,
47+
LLMQ_TYPE_400_60: 2,
48+
4849
// 400 members, 340 (85%) threshold, one every 24 hours (576 blocks)
49-
LLMQ_TYPE_100_67: 4,
50+
LLMQ_TYPE_400_85: 3,
51+
5052
// 100 members, 67 (67%) threshold, one every 24 hours (576 blocks)
51-
LLMQ_TYPE_LLMQ_TEST: 100,
53+
LLMQ_TYPE_100_67: 4,
54+
55+
// 60 members, 45 (75%) threshold, one every 12 hours
56+
LLMQ_TYPE_60_75: 5,
57+
5258
// 3 members, 2 (66%) threshold, one per hour (24 blocks)
5359
// Params might differ when -llmqtestparams is used
54-
LLMQ_TYPE_LLMQ_DEVNET: 101,
60+
LLMQ_TYPE_LLMQ_TEST: 100,
61+
5562
// 10 members, 6 (60%) threshold, one per hour (24 blocks)
5663
// Params might differ when -llmqdevnetparams is used
64+
LLMQ_TYPE_LLMQ_DEVNET: 101,
65+
66+
// 3 members, 2 (66%) threshold, one per hour.
67+
// Params might differ when -llmqtestparams is used
5768
LLMQ_TYPE_TEST_V17: 102,
69+
70+
// 4 members, 2 (66%) threshold, one per hour.
71+
// Params might differ when -llmqtestparams is used
72+
LLMQ_TYPE_TEST_DIP0024: 103,
73+
74+
// 3 members, 2 (66%) threshold, one per hour.
75+
// Params might differ when -llmqtestinstantsendparams is used
76+
LLMQ_TYPE_TEST_INSTANTSEND: 104,
5877
},
59-
LLMQ_SIGN_HEIGHT_OFFSET: 8,
6078

6179
// when selecting a quorum for signing and verification, we use this offset as
6280
// starting height for scanning. This is because otherwise the resulting signatures
6381
// would not be verifiable by nodes which are not 100% at the chain tip.
64-
SMLSTORE_MAX_DIFFS: 720, // keep diffs for 30 hours (720 blocks)
82+
LLMQ_SIGN_HEIGHT_OFFSET: 8,
83+
84+
// keep diffs for 30 hours (720 blocks)
85+
SMLSTORE_MAX_DIFFS: 720,
6586
};

lib/deterministicmnlist/QuorumEntry.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ QuorumEntry.getParams = function getParams(llmqType) {
297297
params.threshold = 30;
298298
params.maximumActiveQuorumsCount = 24;
299299
return params;
300+
case constants.LLMQ_TYPES.LLMQ_TYPE_60_75:
301+
params.size = 60;
302+
params.threshold = 45;
303+
params.maximumActiveQuorumsCount = 32;
304+
return params;
300305
case constants.LLMQ_TYPES.LLMQ_TYPE_400_60:
301306
params.size = 400;
302307
params.threshold = 240;
@@ -327,6 +332,16 @@ QuorumEntry.getParams = function getParams(llmqType) {
327332
params.threshold = 2;
328333
params.maximumActiveQuorumsCount = 2;
329334
return params;
335+
case constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024:
336+
params.size = 4;
337+
params.threshold = 2;
338+
params.maximumActiveQuorumsCount = 2;
339+
return params;
340+
case constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND:
341+
params.size = 3;
342+
params.threshold = 2;
343+
params.maximumActiveQuorumsCount = 2;
344+
return params;
330345
default:
331346
throw new Error(`Invalid llmq type ${llmqType}`);
332347
}

lib/deterministicmnlist/SimplifiedMNList.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,17 @@ SimplifiedMNList.prototype.getLLMQTypes = function getLLMQTypes() {
368368
case Networks.livenet.name:
369369
llmqTypes = [
370370
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
371+
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
371372
constants.LLMQ_TYPES.LLMQ_TYPE_400_60,
372373
constants.LLMQ_TYPES.LLMQ_TYPE_400_85,
374+
constants.LLMQ_TYPES.LLMQ_TYPE_100_67,
373375
];
374376
return llmqTypes;
375377
case Networks.testnet.name:
376378
if (this.mnList.length > 100) {
377379
llmqTypes = [
378380
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
381+
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
379382
constants.LLMQ_TYPES.LLMQ_TYPE_400_60,
380383
constants.LLMQ_TYPES.LLMQ_TYPE_400_85,
381384
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_V17,
@@ -387,17 +390,23 @@ SimplifiedMNList.prototype.getLLMQTypes = function getLLMQTypes() {
387390
llmqTypes = [
388391
constants.LLMQ_TYPES.LLMQ_TYPE_LLMQ_TEST,
389392
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
393+
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
390394
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_V17,
395+
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND,
396+
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024,
391397
];
392398
return llmqTypes;
393399
}
394400
// devnet
395401
llmqTypes = [
396402
constants.LLMQ_TYPES.LLMQ_TYPE_LLMQ_DEVNET,
397403
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
404+
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
398405
constants.LLMQ_TYPES.LLMQ_TYPE_400_60,
399406
constants.LLMQ_TYPES.LLMQ_TYPE_400_85,
400407
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_V17,
408+
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND,
409+
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024,
401410
];
402411
return llmqTypes;
403412
default:

0 commit comments

Comments
 (0)