Skip to content

Move the rust-dashcore pin past #1379 and drop the copied collateral helpers #5913

Open

Description

@llbartekll

Summary

#5890 pins rust-dashcore dev at 6b985d1f (the merge of dashpay/rust-dashcore#1391). The pin should move to a later dev commit, at or after d659dcd1, which needs two changes in Platform.

Why the pin stopped at 6b985d1f

dashpay/rust-dashcore#1379 makes dashcore::signer::verify_data_signature refuse a high-S ECDSA signature itself, with the error "the signature has a high S value".

packages/rs-dpp/src/util/ecdsa.rs assumes the older order: dashcore verifies the signature, then Platform refuses a high-S one with EcdsaError::VerifyFailed ("signature verification failed"). That text ends up in InvalidStateTransitionSignatureError and BasicECDSAError.

With a pin past #1379 the dpp test state_transition::tests::should_refuse_a_high_s_ecdsa_signature_at_every_protocol_version fails:

  • its sanity check expects dashcore alone to verify the high-S twin;
  • the error message of a refused high-S signature changes.

Seen in CI on #5890 with the pin at d659dcd1, and reproduced locally.

What to do

  1. Adapt packages/rs-dpp/src/util/ecdsa.rs so a high-S signature is still refused with the same error as before at every protocol version, and update the test's sanity check.

  2. Move the eight rev lines in the root Cargo.toml to the chosen dev commit and refresh Cargo.lock.

  3. Drop the two helpers copied into packages/rs-platform-wallet/src/wallet/outpoint_locks.rs and call the ones feat(key-wallet): expose masternode_collateral and holds_coin rust-dashcore#1400 made public instead:

    • registration_collateral -> key_wallet::wallet::managed_wallet_info::masternode_collateral
    • PlatformWalletInfo::holds_coin -> ManagedWalletInfo::holds_coin

    The upstream holds_coin also counts a coin kept aside as spent, so a tracked masternode's collateral whose spend a fork drops is recognised as held. The local copy looks only at unspent coins. Commit e0f5d97bea on the feat(platform-wallet): keep masternode collateral out of coin selection #5890 branch has this change; it was reverted there only because of the pin.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupA refactoring or something that tidies up the project.platform-wallet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions