Skip to content

Commit

Permalink
feat: add single node quorum
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Dec 18, 2024
1 parent 8b249a1 commit a61df6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ module.exports = {
// for devnet testing only
// 12 members, 8 (67%) threshold, one per hour
LLMQ_DEVNET_PLATFORM: 107,
// for testing only
// 1 member.
LLMQ_SINGLE_NODE: 111,
},

// when selecting a quorum for signing and verification, we use this offset as
Expand Down
5 changes: 5 additions & 0 deletions lib/deterministicmnlist/QuorumEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ QuorumEntry.getParams = function getParams(llmqType) {
params.threshold = 8;
params.maximumActiveQuorumsCount = 4;
return params;
case constants.LLMQ_TYPES.LLMQ_SINGLE_NODE:
params.size = 1;
params.threshold = 1;
params.maximumActiveQuorumsCount = 2;
return params;
default:
throw new Error(`Invalid llmq type ${llmqType}`);
}
Expand Down
1 change: 1 addition & 0 deletions lib/deterministicmnlist/SimplifiedMNList.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ SimplifiedMNList.prototype.getLLMQTypes = function getLLMQTypes() {
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_INSTANTSEND,
constants.LLMQ_TYPES.LLMQ_TYPE_TEST_DIP0024,
constants.LLMQ_TYPES.LLMQ_TEST_PLATFORM,
constants.LLMQ_TYPES.LLMQ_SINGLE_NODE,
];
return llmqTypes;
}
Expand Down

0 comments on commit a61df6a

Please sign in to comment.