Skip to content

chore(deps): upgrade @theqrl/web3 to 2.0.0 - #62

Merged
moscowchill merged 4 commits into
devfrom
chore/web3-2
Nov 3, 2026
Merged

moscowchill merged 4 commits into
devfrom
chore/web3-2

Conversation

@moscowchill

Copy link
Copy Markdown
Contributor

Upgrades @theqrl/web3 to 2.0.0 (published 2 Nov from theQRL/web3.js #118) in the root tooling, the contract exporter and the frontend.

  • Event topics: 2.0.0's encodeEventSignature returns the 64-byte VM64 topic (hash in the high 32 bytes). The frontend's native log filter now takes that topic as is and refuses the bare 32-byte hash 1.x returned, so a mixed-version mistake fails loudly; tested both ways.
  • Tooling and exporter: driven through web3 2.0.0 in tests (exporter and deployer loader).
  • Frontend decode: a test pins the checksummed beneficiary address 2.0.0 decodes.

Reviewed adversarially (approve); all repo gates passed on 3103544 locally. CI on this PR is the remote proof.

The root tooling and monitoring/contract-exporter move from ^1.0.3 to
^2.0.0. A caret range never crosses a major, so both needed the edit.
Every @theqrl/web3* package resolves to 2.0.0 with one copy each, and
web3-qrl-iban and web3-providers-ipc leave both trees with the umbrella.

Root overrides:
- Drop the $-overrides for @theqrl/mldsa87, @theqrl/wallet.js and
  @theqrl/qrl-cryptography. 2.0.0 pins mldsa87 2.2.0, wallet.js 6.3.0
  and qrl-cryptography 0.3.3 itself, and npm ls shows a single copy of
  each.
- Keep ws ^8.21.0 as the ws security floor; it lifts the providers-ws
  pin from 8.22.0 to 8.22.1.
- Keep tmp and follow-redirects. Nothing in the current tree resolves
  them; they stay as floors for a future dependency.

The exporter had no crypto overrides and now gets mldsa87 2.2.0,
wallet.js 6.3.0 and qrl-cryptography 0.3.3 (from 2.1.3, 6.2.3, 0.3.0).
Its qs override is unrelated and stays.

npm audit: root 17 high to 0. Exporter 22 (17 high, 5 moderate) to 5
moderate, the qs, express, body-parser, minimatch and nodemon entries it
already had. The 17 highs were the web3 chain over the validator's
nested zod 3.22.3; 2.0.0's validator ships zod 4.6.7.

No source change is needed here: the scripts sign type 2 with fee-market
fields, deployer seeds are already normalized to 0x, and the finality
proposal ids encode identically under both versions.
The existing suites hand both modules a fake web3, so nothing showed
that they work with the installed client.

- native-monitoring: the exporter scrapes one block through the real
  @theqrl/web3 client and a local JSON-RPC endpoint that echoes request
  ids. 2.0.0 refuses a reply with another id, decodes addresses as
  checksummed Q addresses and decodes every word strictly; the finality
  and portfolio bindings go through those decoded addresses. The case
  passes on 1.0.3 as well, so the exporter's behaviour is unchanged.
- loadDeployer: a bare, 0X and padded 0x seed each reach web3 as the 0x
  form and load the same account. 2.0.0 refuses the bare hex with
  InvalidSeedError, which the case also pins; 1.0.3 accepted it.
…4-byte topic

The staking frontend moves from ^1.0.3 to ^2.0.0. Every @theqrl/web3*
package resolves to 2.0.0 with one copy each. The exact overrides for
@theqrl/mldsa87 (2.2.0), @theqrl/wallet.js (6.3.0) and
@theqrl/qrl-cryptography (0.3.3) are dropped: 2.0.0 pins the same
versions, and @qrlwallet/connect's ^2.1.1 mldsa87 range dedupes to the
same copy. The overrides for brace-expansion, esbuild, js-yaml, nanoid,
postcss and socket.io-parser pin packages outside web3 and stay.

npm audit: production 17 high to 0; the full tree 32 to 15, the eslint,
minimatch, brace-expansion, source-map-js and vite entries it already
had.

Activity feed: abi.encodeEventSignature returned the bare 32-byte
keccak hash in 1.x and returns the 64-byte VM64 topic in 2.0.0, the
hash in the high 32 bytes and zeros in the low 32 bytes. nativeEventTopics
required the 32-byte form and padded it, so on 2.0.0 every activity
query threw "Invalid native event filter": a connected account saw
"Activity history is unavailable from this RPC" and an empty refund
list. It now takes the 64-byte topic and requires the zero low half.
The qrl_getLogs request is byte-for-byte the one 1.0.3 sent. A 32-byte
signature fails closed before any request, so a future change in the
library's topic layout shows up as an error.

The comment above the raw request named a 1.x validator limit that
2.0.0 lifts; it now records that history and why the request stays raw.

Tests: the topic fixtures use the 64-byte form, the decoder test checks
that the high half is keccak256 of the event signature, and new cases
refuse the 32-byte width, a low-aligned hash and a non-zero low half.
Since @theqrl/web3 2.0.0, decoded addresses come back with QIP-55
checksum casing; 1.x returned the lowercase body. The refund list checks
each getPending beneficiary with isQrlAddress, which accepts a
mixed-case body only when it matches the app's own SHAKE-256 checksum.
The existing case used a digits-only address, where casing never shows.

The new case decodes a getPending record with the installed web3, for an
account with hex letters, checks that the beneficiary is mixed case, and
expects the refund list to hold the deposit with no activity error.
@moscowchill
moscowchill merged commit 5fb90b3 into dev Nov 3, 2026
2 checks passed
@moscowchill
moscowchill deleted the chore/web3-2 branch November 3, 2026 20:30
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.

1 participant