Skip to content

feat(wallet-lib): dump wallet storage#8

Merged
shumkov merged 1 commit into
v0.22-devfrom
feat/dump-wallet-storage
Nov 3, 2021
Merged

feat(wallet-lib): dump wallet storage#8
shumkov merged 1 commit into
v0.22-devfrom
feat/dump-wallet-storage

Conversation

@jawid-h
Copy link
Copy Markdown
Contributor

@jawid-h jawid-h commented Nov 3, 2021

Issue being fixed or feature implemented

The change allows wallet users to dump storage on demand for debugging purposes

What was done?

Created a new function dumpStorage which returns storage JSON string and logs it to the console if not specified otherwise

How Has This Been Tested?

Tested function during different phases of the wallet lifecycle (initialized/disconnected/crashed)

Breaking Changes

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

@jawid-h jawid-h added this to the v0.22.0 milestone Nov 3, 2021
@shumkov shumkov merged commit 2722058 into v0.22-dev Nov 3, 2021
@shumkov shumkov deleted the feat/dump-wallet-storage branch November 3, 2021 15:12
thephez referenced this pull request in thephez/platform Nov 29, 2021
Co-authored-by: igor <igor.markin@vereign.com>
shumkov pushed a commit that referenced this pull request Nov 23, 2022
shumkov pushed a commit that referenced this pull request Nov 23, 2022
feat : add document errors, transition, validation
shumkov added a commit that referenced this pull request Apr 29, 2026
Apply the thin-wrapper principle (codified in CONVENTIONS.md): wasm-dpp2
does not duplicate or pre-empt rs-dpp validation logic. Audit found four
size caps in wasm-dpp2 that violated the principle:

- MAX_HALO2_PROOF_BYTES = 64 KB (wasm-only invention; rs-dpp does not
  validate proof byte length)
- MAX_CORE_SCRIPT_BYTES = 10 KB (wasm-only invention)
- MAX_RECOVERABLE_ECDSA_SIGNATURE_BYTES = 65 (wasm-only invention)
- MAX_P2SH_SIGNATURES = 17 in AddressWitness::p2sh constructor (duplicates
  rs-dpp's check in custom Serialize/Deserialize at
  packages/rs-dpp/src/address_funds/witness.rs)

Drop all four. The 5 shielded transition constructors no longer call
`check_max_len` for proof / output_script / signature; the AddressWitness
P2SH constructor no longer rejects signature counts above 17. DPP catches
each constraint at the appropriate validation tier:

- proof emptiness via `validate_proof_not_empty`
- output_script via dashcore parse on consumption
- ECDSA signature via `BinaryData` deserialization in the parent transition
- P2SH count via the custom Serialize/Deserialize on `AddressWitness`

This also resolves thepastaclaw's review #8 (fromJSON/fromObject bypassed
the constructor caps) by making the inconsistency moot — there are no caps
in either path now.

The fixed-size byte conversions for `anchor: [u8; 32]` and
`binding_signature: [u8; 64]` stay (`try_vec_to_fixed_bytes`) because
they're structural conversions required by the Rust type system, not
validation — covered by the explicit narrow exception in CONVENTIONS.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to 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