Skip to content

fix(dashmate): local nodes missing envs after group reset - #839

Closed
pshenmic wants to merge 8 commits into
v0.24-devfrom
fix/dashmate-group-reset
Closed

fix(dashmate): local nodes missing envs after group reset#839
pshenmic wants to merge 8 commits into
v0.24-devfrom
fix/dashmate-group-reset

Conversation

@pshenmic

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

After dashmate group reset, nodes fails to start due some contracts private key is missing

#785

What was done?

Moved contracts private keys generation in the separate factory and used it in the setup and reset phases

How Has This Been Tested?

Locally

Breaking Changes

No

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

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@pshenmic
pshenmic changed the base branch from v0.24-dev to masterMarch 21, 2023 13:13
* @param {generateHDPrivateKeys} generateHDPrivateKeys
* @return {configureTenderdashTask}
*/
function configureContractsPrivateKeysTaskFactory(generateHDPrivateKeys) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

generateSystemDataContractKeysTask

config.set('platform.featureFlags', baseConfig.platform.featureFlags);
config.set('platform.masternodeRewardShares', baseConfig.platform.masternodeRewardShares);

subTasks.unshift({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why so?

@pshenmic
pshenmic changed the base branch from master to v0.24-devApril 18, 2023 19:05
…up-reset
# Conflicts:
#	packages/dashmate/src/commands/group/reset.js
#	packages/dashmate/src/createDIContainer.js
#	packages/dashmate/src/listr/tasks/setup/setupLocalPresetTaskFactory.js
Comment on lines +66 to +76
// eslint-disable-next-line no-param-reassign
task.output = `DPNS Private Key: ${dpnsPrivateKey.toString()}`;

// eslint-disable-next-line no-param-reassign
task.output = `Feature Flags Private Key: ${featureFlagsPrivateKey.toString()}`;

// eslint-disable-next-line no-param-reassign
task.output = `Dashpay Private Key: ${dashpayPrivateKey.toString()}`;

// eslint-disable-next-line no-param-reassign
task.output = `Masternode Reward Shares Private Key: ${masternodeRewardSharesPrivateKey.toString()}`;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we don't need this anymore

const subTasks = ctx.configGroup.map((config, i) => (
{
title: `Create ${config.getName()} config`,
// eslint-disable-next-line consistent-return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Bad idea

task: () => generateSystemDataContractKeysTask(config, config.get('network')),
},
{
task: () => resetNodeTask(config),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Didn't we reset config there?

task: () => resetNodeTask(config),
},
{
task: () => generateSystemDataContractKeysTask(config, config.get('network')),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you test it? I think it won't work because all configs will have different keys now so init chain won't be deterministic. If you see how it worked before. We generated it once on setup and set to all configs. You should do the same

@pshenmic
pshenmic marked this pull request as draft April 20, 2023 14:11
@pshenmic

Copy link
Copy Markdown
ContributorAuthor

Fixed in #991

@pshenmicpshenmic closed this May 1, 2023
@shumkov
shumkov deleted the fix/dashmate-group-reset branch August 25, 2024 08:51
shumkov added a commit that referenced this pull request Jul 4, 2026
Bring the branch up to v4.1-dev, which bumps rust-dashcore to afcff156:
key-wallet now impls `Zeroize` + `Drop` on `ExtendedPrivKey`, and
`extended_public_key` moved into the new `ExtendedPubKeySigner` subtrait.
Conflicts resolved (take base's rust-dashcore, afcff156):
- Cargo.toml / Cargo.lock: base's afcff156 rev.
- packages/rs-sdk-ffi/src/mnemonic_resolver_core_signer.rs: reconcile the
derive-sign-destroy zeroization with the upstream change.
- `WipingXprv` REMOVED — it was a local workaround for `ExtendedPrivKey`
having no `Drop`, which key-wallet now provides (dashcore PR #833, added
specifically for this signer). The bare value self-wipes on every path.
- `WipingSecretKey` KEPT — the `secp256k1::SecretKey` copy at the two sign
sites is the one key intermediate #833 cannot cover (`SecretKey` is an
upstream type with no `Zeroize`, only `non_secure_erase()`), so the RAII
guard remains the only way to close its `?`-early-return / panic leak
window. Preserves the "no key bytes survive the trait boundary" invariant.
- `extended_public_key` moved into an `impl ExtendedPubKeySigner` block
(dashcore #839).
Bump ripple + follow-through:
- packages/rs-platform-wallet-ffi/src/dashpay.rs: import `ExtendedPubKeySigner`
for `receiving_xpub` (the method moved off `Signer`).
- packages/rs-platform-wallet-ffi/src/sign_with_mnemonic_resolver.rs: drop its
own now-redundant `WipingXprv`, relying on `ExtendedPrivKey`'s upstream Drop.
rs-sdk-ffi + platform-wallet-ffi build; 300 + 8 tests pass (incl. the 12
resolver-signer tests); full-workspace build green; fmt + clippy clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
shumkov added a commit that referenced this pull request Jul 4, 2026
…endedPubKeySigner
The v4.1-dev merge bumped rust-dashcore to afcff156, which (dashcore #839)
moved `extended_public_key` out of `key_wallet::signer::Signer` into the new
`ExtendedPubKeySigner: Signer` subtrait. Production callers were migrated in the
merge, but four test-code signer impls still declared the method on `Signer` /
`KwSigner`, so the workspace test build failed with `error[E0407]: method
extended_public_key is not a member of trait ...` (dpp + platform-wallet lib
tests). A plain `cargo build --workspace` compiles no test targets, which is
why the merge's build looked clean; `cargo check --workspace --all-targets`
surfaces it.
Move the method into a separate `impl ExtendedPubKeySigner` block for each test
signer (FixedKeySigner ×3, SeedSigner ×1); bodies are byte-for-byte identical
(`ExtendedPubKeySigner: Signer` inherits the associated Error), so this is a
pure trait-membership move, no behavior change. `cargo check --workspace
--all-targets` clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
QuantumExplorer added a commit that referenced this pull request Aug 26, 2026
grovedb #839 (squashed as 6c882c3e) retires the standalone indexed-axis
provers/verifiers, leaving PathQuery as the only public proof surface.
This PR already routes everything through PathQuery, so the bump is a
pin move from develop~1 (6b34ea81) with no platform code changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
QuantumExplorer added a commit that referenced this pull request Aug 26, 2026
…prover retirement
grovedb #836 gave the unified unproved read the attested skip
(`PathQueryRun::AxisKeys/AxisEntries { .., skipped }`), and #839
retired the standalone indexed-axis provers, verifiers and read entry
points outright — PathQuery is grovedb's only public surface for the
family. The pin moves to that head and platform completes the
unification it was waiting on:
- Single-prefix unproved reads (ranked top-k and having-range) are one
`run_path_query` over `PathQuery::new_axis` with the keys-only
projection; the per-axis triple dispatches are gone, and the rank
attestation maps from the new `skipped` field (its absence on a
paginated read is corrupted state, not a default).
- Single-prefix proofs are `prove_query(new_axis_top_k /
new_axis_bounded)`; since transactional proving no longer exists
anywhere, the committed-state-only guard covers single-prefix and
branched proves alike.
- Single-prefix verification matches
`VerifiedPathQuery::AxisEntries { root_hash, entries, skipped }`
through the same shared mappers as the branched arms.
- Every read, proof and verification on both surfaces now builds
exactly one PathQuery per external query; rs-drive re-exports
`grovedb_query` so downstream crates can construct axis queries.
Two semantic upgrades ride the retirement, both now pinned by tests:
- A bound matching nothing against an EMPTY secondary proves: the
envelope commits the element's empty secondary, authenticating
complete absence instead of refusing ("Cannot create proof for empty
tree" is gone from this surface; drive-abci's InvalidArgument mapping
for that class is vestigial here and kept as dead-defensive).
- The limit binds by RECONSTRUCTION, not echo: the verifier re-executes
the proof under the queried limit, so an exhausted-walk proof is a
complete answer under any cap that admits it (the old echo check
rejected that soundly-verifiable case), while the dangerous direction
— a proof truncated by a smaller limit verified under a larger cap —
is rejected for missing coverage. The tamper test now pins BOTH
directions; it previously exercised only the benign one.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pshenmic@shumkov