feat(wallet-lib): dump wallet storage#8
Merged
Conversation
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
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>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
dumpStoragewhich returns storage JSON string and logs it to the console if not specified otherwiseHow Has This Been Tested?
Tested function during different phases of the wallet lifecycle (initialized/disconnected/crashed)
Breaking Changes
Checklist:
For repository code-owners and collaborators only