Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Apr 21, 2022
2 parents 4e5603e + 79267b8 commit 71fb97d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 8 deletions.
37 changes: 29 additions & 8 deletions lib/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,47 @@ module.exports = {
// In duffs
INSTANTSEND_FEE_PER_INPUT: 10000,
LLMQ_TYPES: {
LLMQ_TYPE_50_60: 1,
// 50 members, 30 (60%) threshold, one per hour (24 blocks)
LLMQ_TYPE_400_60: 2,
LLMQ_TYPE_50_60: 1,

// 400 members, 240 (60%) threshold, one every 12 hours (288 blocks)
LLMQ_TYPE_400_85: 3,
LLMQ_TYPE_400_60: 2,

// 400 members, 340 (85%) threshold, one every 24 hours (576 blocks)
LLMQ_TYPE_100_67: 4,
LLMQ_TYPE_400_85: 3,

// 100 members, 67 (67%) threshold, one every 24 hours (576 blocks)
LLMQ_TYPE_LLMQ_TEST: 100,
LLMQ_TYPE_100_67: 4,

// 60 members, 45 (75%) threshold, one every 12 hours
LLMQ_TYPE_60_75: 5,

// 3 members, 2 (66%) threshold, one per hour (24 blocks)
// Params might differ when -llmqtestparams is used
LLMQ_TYPE_LLMQ_DEVNET: 101,
LLMQ_TYPE_LLMQ_TEST: 100,

// 10 members, 6 (60%) threshold, one per hour (24 blocks)
// Params might differ when -llmqdevnetparams is used
LLMQ_TYPE_LLMQ_DEVNET: 101,

// 3 members, 2 (66%) threshold, one per hour.
// Params might differ when -llmqtestparams is used
LLMQ_TYPE_TEST_V17: 102,

// 4 members, 2 (66%) threshold, one per hour.
// Params might differ when -llmqtestparams is used
LLMQ_TYPE_TEST_DIP0024: 103,

// 3 members, 2 (66%) threshold, one per hour.
// Params might differ when -llmqtestinstantsendparams is used
LLMQ_TYPE_TEST_INSTANTSEND: 104,
},
LLMQ_SIGN_HEIGHT_OFFSET: 8,

// when selecting a quorum for signing and verification, we use this offset as
// starting height for scanning. This is because otherwise the resulting signatures
// would not be verifiable by nodes which are not 100% at the chain tip.
SMLSTORE_MAX_DIFFS: 720, // keep diffs for 30 hours (720 blocks)
LLMQ_SIGN_HEIGHT_OFFSET: 8,

// keep diffs for 30 hours (720 blocks)
SMLSTORE_MAX_DIFFS: 720,
};
15 changes: 15 additions & 0 deletions lib/deterministicmnlist/QuorumEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ QuorumEntry.getParams = function getParams(llmqType) {
params.threshold = 30;
params.maximumActiveQuorumsCount = 24;
return params;
case constants.LLMQ_TYPES.LLMQ_TYPE_60_75:
params.size = 60;
params.threshold = 45;
params.maximumActiveQuorumsCount = 32;
return params;
case constants.LLMQ_TYPES.LLMQ_TYPE_400_60:
params.size = 400;
params.threshold = 240;
Expand Down Expand Up @@ -327,6 +332,16 @@ QuorumEntry.getParams = function getParams(llmqType) {
params.threshold = 2;
params.maximumActiveQuorumsCount = 2;
return params;
case constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024:
params.size = 4;
params.threshold = 2;
params.maximumActiveQuorumsCount = 2;
return params;
case constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND:
params.size = 3;
params.threshold = 2;
params.maximumActiveQuorumsCount = 2;
return params;
default:
throw new Error(`Invalid llmq type ${llmqType}`);
}
Expand Down
9 changes: 9 additions & 0 deletions lib/deterministicmnlist/SimplifiedMNList.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,17 @@ SimplifiedMNList.prototype.getLLMQTypes = function getLLMQTypes() {
case Networks.livenet.name:
llmqTypes = [
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
constants.LLMQ_TYPES.LLMQ_TYPE_400_60,
constants.LLMQ_TYPES.LLMQ_TYPE_400_85,
constants.LLMQ_TYPES.LLMQ_TYPE_100_67,
];
return llmqTypes;
case Networks.testnet.name:
if (this.mnList.length > 100) {
llmqTypes = [
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
constants.LLMQ_TYPES.LLMQ_TYPE_400_60,
constants.LLMQ_TYPES.LLMQ_TYPE_400_85,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_V17,
Expand All @@ -387,17 +390,23 @@ SimplifiedMNList.prototype.getLLMQTypes = function getLLMQTypes() {
llmqTypes = [
constants.LLMQ_TYPES.LLMQ_TYPE_LLMQ_TEST,
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_V17,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024,
];
return llmqTypes;
}
// devnet
llmqTypes = [
constants.LLMQ_TYPES.LLMQ_TYPE_LLMQ_DEVNET,
constants.LLMQ_TYPES.LLMQ_TYPE_50_60,
constants.LLMQ_TYPES.LLMQ_TYPE_60_75,
constants.LLMQ_TYPES.LLMQ_TYPE_400_60,
constants.LLMQ_TYPES.LLMQ_TYPE_400_85,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_V17,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024,
];
return llmqTypes;
default:
Expand Down

0 comments on commit 71fb97d

Please sign in to comment.