Skip to content

feat: override LLMQ params - #310

Merged
shumkov merged 7 commits into
masterfrom
feat/override-llmq-params
Apr 16, 2025
Merged

shumkov merged 7 commits into
masterfrom
feat/override-llmq-params

Conversation

@shumkov

@shumkov shumkov commented Apr 11, 2025 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

We use custom quorum params for the local network in order to use only one masternode instead of 3

What was done?

  • Added an argument to SML classes to override LLMQ params

How Has This Been Tested?

As a part of test suite

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

@shumkov shumkov self-assigned this Apr 11, 2025
@shumkov shumkov removed this from Platform team Apr 11, 2025
@shumkov shumkov moved this to In review / testing in Platform team Apr 11, 2025
@shumkov
shumkov marked this pull request as ready for review April 11, 2025 17:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an option to override default LLMQ parameters by adding an optional llmqParamsOverride argument across various classes. Key changes include:

  • Adding llmqParamsOverride to payload parsing in CommitmentTxPayload.
  • Propagating llmqParamsOverride in SimplifiedMNListDiff and SimplifiedMNList helper functions.
  • Modifying QuorumEntry and constants to support quorum parameter overrides.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/transaction/payload/commitmenttxpayload.js Updated fromBuffer to accept and pass llmqParamsOverride to QuorumEntry.getParams.
lib/deterministicmnlist/SimplifiedMNListDiff.js Added llmqParamsOverride parameter to constructors and parsing functions (fromBuffer, fromObject, fromHexString, fromJSON).
lib/deterministicmnlist/SimplifiedMNList.js Propagated llmqParamsOverride through the constructor and related methods.
lib/deterministicmnlist/QuorumEntry.js Revised constructor and helper methods to handle llmqParamsOverride and merged parameters using _.merge.
lib/constants/index.js Defined LLMQ_TYPE_PARAMS to centralize default quorum parameters.
Comments suppressed due to low confidence (1)

lib/deterministicmnlist/QuorumEntry.js:75

  • The check 'if (arg instanceof QuorumEntry)' is repeated in the constructor. Removing the duplicate check can simplify the logic and improve clarity.
if (arg instanceof QuorumEntry) {

@shumkov
shumkov merged commit 876d0f6 into master Apr 16, 2025
@github-project-automation github-project-automation Bot moved this from In review / testing to Done in Platform team Apr 16, 2025
@shumkov
shumkov deleted the feat/override-llmq-params branch April 16, 2025 14:33
PastaPastaPasta added a commit that referenced this pull request Oct 28, 2026
* fix: allow 32 active LLMQ_60_75 quorums again

The LLMQ params table added in #310 set maximumActiveQuorumsCount for
LLMQ_60_75 to 24. Core keeps 32 of them active (signingActiveQuorumCount),
as 0.22 did, and every current mainnet and testnet masternode list diff
carries 32, so SimplifiedMNList rejected them since 0.25.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: hash Core V24 ExtAddr masternode list entries

Core V24 activates ProTx version 3 (ExtAddr). Its simplified masternode
list entries serialize addresses as ExtNetInfo instead of a single
service, and evonodes no longer serialize platformHTTPPort. dashcore-lib
still hashed them in the legacy layout, so the merkle root over any list
containing a v3 entry stopped matching the coinbase and SimplifiedMNList
rejected every testnet diff after the fork.

Serialize v3 entries from the `addresses` object Core reports, which for
ExtNetInfo is the address map itself. Take `service` and
`platformHTTPPort` from it when Core omits the deprecated fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: allow SML entry input without service

ExtAddr entries may omit the deprecated `service` field; fromObject
derives it from `addresses`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: take SML entry endpoint fields from the hashed addresses

ExtAddr entries hash `addresses`, not `service` or `platformHTTPPort`,
so a reported value that disagrees with `addresses` would pass the
merkle root check and redirect getIp(). Always derive both from
`addresses` for them. Legacy entries hash those fields, so keep the
reported values and only fill them in from `addresses` when Core omits
them. A revoked legacy evonode keeps its port but reports no addresses,
so it is still rejected without the deprecated field.

Copy `addresses` on input as toObject() does on output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: reject ExtNetInfo input Core would not accept

Enforce Core's limit of four entries per purpose
(MAX_ENTRIES_EXTNETINFO), and reject base32 Tor and I2P hosts with
non-zero leftover bits. Without that check, two I2P strings decode to
the same hashed bytes. Also type the version, type and evonode fields
SMLEntry input may carry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: strip brackets from IPv6 addresses in getIp()

ExtAddr entries may have an IPv6 core_p2p address, which Core prints as
"[addr]:port". Splitting it on the first colon returned "[2001".

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants