Skip to content

Conversation

@sqhell
Copy link

@sqhell sqhell commented Jan 7, 2026

Changes

  • Migrated from ChainSafe librustzcash fork (46e8ee09) to official zcash/librustzcash (a40ee353) per PR Point upstream librustcash #139
  • Updated WebWallet constructor to use new ConfirmationsPolicy API (trusted/untrusted confirmations)
  • Added validation module with unit tests for confirmations policy parameter validation
  • Fixed e2e test infrastructure: added COOP/COEP headers for SharedArrayBuffer support
  • Updated Playwright config with proper browser args and timeout for WASM loading

Details

The breaking change was the Zcash NU6 (Network Upgrade 6) update in the official librustzcash.

Specifically:

Version Status
ChainSafe fork 46e8ee09 Was working (old)
Official c3425f9c3 Broken (bip32 0.6.0-pre.1 dependency hell)
Official a40ee353 Working (what PR #139 uses)

Quick Checklist for Infra Team

Item Action Required
COOP/COEP headers Yes - add to production web server
WebWallet constructor Yes - update all call sites
Dependencies No - handled at build time
Database schema No changes
API endpoints No changes
Build commands No changes

Test Before Deploying

They can verify headers are working by checking browser console:
// Should return true if headers are set correctly
console.log(typeof SharedArrayBuffer !== 'undefined')

Tests

Run unit tests for ConfirmationsPolicy validation

cargo test --package webzjs-wallet --lib validation

Run e2e tests (requires yarn and playwright)

cd packages/e2e-tests
yarn install
npx playwright test --project=chromium

Issues

  • Fixes compatibility with NU6 network upgrade
  • Resolves SharedArrayBuffer initialization failures in Chromium browsers

@sqhell sqhell requested a review from salindne January 7, 2026 19:10
@sqhell sqhell requested a review from irubido January 7, 2026 20:47
Copy link
Contributor

@irubido irubido left a comment

Choose a reason for hiding this comment

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

Looks good to me,
but still wallet does not work when built in WASM.

got this error in browser console

webzjs_wallet.js:1621 panicked at /home/ivan/.cargo/git/checkouts/librustzcash-c2c6180a1a11d4fa/a40ee35/zcash_client_memory/src/wallet_read.rs:734:9:
not yet implemented

@rob1997
Copy link
Contributor

rob1997 commented Jan 22, 2026

@sqhell has the WASM panic issue been resolved?

Looks good to me, but still wallet does not work when built in WASM.

got this error in browser console

webzjs_wallet.js:1621 panicked at /home/ivan/.cargo/git/checkouts/librustzcash-c2c6180a1a11d4fa/a40ee35/zcash_client_memory/src/wallet_read.rs:734:9:
not yet implemented

Copy link
Contributor

@rob1997 rob1997 left a comment

Choose a reason for hiding this comment

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

  • Fix the WASM panic by ensuring the librustzcash fork has the required implementation
  • Test WASM build in browser environment
  • Verify get_wallet_summary() works after wallet creation
  • Update README.md to reflect new constructor signature (currently shows old API), line 37 to show new constructor

@rob1997 rob1997 requested review from LesnyRumcajs and ec2 January 22, 2026 10:24
@LesnyRumcajs
Copy link
Member

@rob1997 I'm not a maintainer of this repository, so I can't really give this change an insightful review.

@LesnyRumcajs LesnyRumcajs removed their request for review January 22, 2026 12:54
@rob1997
Copy link
Contributor

rob1997 commented Jan 22, 2026

@rob1997 I'm not a maintainer of this repository, so I can't really give this change an insightful review.

gotcha, no worries. besides @sqhell we're all rust noobs here that's why I had assigned you :)

@irubido
Copy link
Contributor

irubido commented Jan 22, 2026

Great job with fix, just some of functionality still throws errors

Managed to sync to block 2978667 quite fast 👍 , transaction worked both to u ant t address.
Only got panic when trying to shield funds after sending them to t address

webzjs_wallet.js:1664 panicked at /home/ivan/.cargo/git/checkouts/librustzcash-nu61-7767c02336992644/0ec0723/zcash_client_backend/src/data_api.rs:1866:9:
not implemented: WalletRead::get_transparent_address_metadata must be overridden for wallets to use the `transparent-inputs` feature

On page refresh i got errors

Saved wallet detected. Restoring wallet from storage
webzjs_wallet.js:1727  INFO webzjs_wallet::bindgen::wallet: Serialized db was provided to constructor. Attempting to deserialize

webzjs_wallet.js:1664 panicked at /home/ivan/.cargo/git/checkouts/librustzcash-nu61-7767c02336992644/0ec0723/zcash_client_memory/src/types/transparent.rs:191:66:
FIXME

and toast message passed to webapp

Wallet data incompatible after upgrade. Please re-sync your wallet.

@rob1997
Copy link
Contributor

rob1997 commented Jan 28, 2026

@sqhell Thanks for addressing the previous feedback.
remaining issues were

  • Shielding Panic (Medium Priority)
panicked at .../data_api.rs:1866:9:not implemented: WalletRead::get_transparent_address_metadata must be overridden
Impact: Users cannot shield transparent funds after sending to t-address

Action needed: Verify/implement get_transparent_address_metadata in the ChainSafe/librustzcash-nu61 fork

  • Wallet Restore Panic (High Priority)
    panicked at .../transparent.rs:191:66: FIXME
    Impact: Wallet restore from storage fails on page refresh (gracefully handled, but forces re-sync)
    Action needed: Resolve the FIXME in transparent.rs:191 in the librustzcash fork

lmk if these are already implemented

@sqhell
Copy link
Author

sqhell commented Jan 28, 2026

@sqhell Thanks for addressing the previous feedback. remaining issues were

  • Shielding Panic (Medium Priority)
panicked at .../data_api.rs:1866:9:not implemented: WalletRead::get_transparent_address_metadata must be overridden
Impact: Users cannot shield transparent funds after sending to t-address

Action needed: Verify/implement get_transparent_address_metadata in the ChainSafe/librustzcash-nu61 fork

  • Wallet Restore Panic (High Priority)
    panicked at .../transparent.rs:191:66: FIXME
    Impact: Wallet restore from storage fails on page refresh (gracefully handled, but forces re-sync)
    Action needed: Resolve the FIXME in transparent.rs:191 in the librustzcash fork

lmk if these are already implemented

@rob1997 cargo update -p zcash_client_memory , you have a cached version, that should fix it

@irubido
Copy link
Contributor

irubido commented Jan 29, 2026

Great work, all functionality works without throwing errors. And especially implementing transaction history: 👍

One issue I found is:
I synced wallet from year ago, block 2811355, then I transefered 0.01 ZEC to it. With all transactions it synec to 0.089 which does seem fine.

Then I closed the browser window and opened again, and balance shwed is 0.01285 ZEC.
Wallet changed balance just from closing the window.

This happened 2 times, I reproduced it twice, once with closer block and it also changed balance after re-opening the app.

branches: [ main ]
paths:
- 'packages/snap/snap.manifest.json'
- 'packages/snap/snap.manifest.base.json'
Copy link
Contributor

Choose a reason for hiding this comment

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

this workflow should check original snap.manifest.json

Comment on lines +27 to +28
"start": "yarn manifest:dev && mm-snap watch",
"dev": "yarn manifest:dev && mm-snap watch",
Copy link
Contributor

Choose a reason for hiding this comment

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

readmes need to be updated for new dev scripts

@@ -1,4 +1,8 @@
export const MAINNET_LIGHTWALLETD_PROXY = 'https://zcash-mainnet.chainsafe.dev';
// For local development (with docker proxy running: docker compose -f traefik/docker-compose.yml up -d)
export const MAINNET_LIGHTWALLETD_PROXY = 'http://localhost:1234/mainnet';
Copy link
Contributor

Choose a reason for hiding this comment

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

this way localhost will be published by workflow to production

@@ -1,4 +1,8 @@
export const MAINNET_LIGHTWALLETD_PROXY = 'https://zcash-mainnet.chainsafe.dev';
// For local development (with docker proxy running: docker compose -f traefik/docker-compose.yml up -d)
export const MAINNET_LIGHTWALLETD_PROXY = 'http://localhost:1234/mainnet';
Copy link
Contributor

Choose a reason for hiding this comment

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

also readme update is needed if dev flow is changed

@irubido
Copy link
Contributor

irubido commented Jan 29, 2026

There is also flow bug, on initial flow creation user is asked to allow viewingKey from snap twice.

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.

6 participants