Skip to content

fix: load native signatures and preserve request confirmation - #1777

Merged
MantisClone merged 1 commit into
masterfrom
fix/REQ-716-sdk-ci-confirmation
Oct 30, 2026
Merged

MantisClone merged 1 commit into
masterfrom
fix/REQ-716-sdk-ci-confirmation

Conversation

@MantisClone

Copy link
Copy Markdown
Contributor

Problem

SDK checks exposed two separate problems: signature recovery can silently fall back to slow JavaScript, and request confirmation can be missed or overwritten by an older refresh. Some tests also compare requests before confirmation or rely on exact wall-clock timing.

This is the non-security prerequisite for #1776, found while validating REQ-716.

Proposed Solution

  • Resolve node-gyp-build to 4.8.4 throughout the workspace and check native secp256k1 loading immediately after CI installation.
  • Retain creation confirmation/error results for late or repeated callers. Process refreshes in order, allowing retries after a failed read.
  • Cover those confirmation races, wait before comparing encrypted requests, and compare public request data. Check retry delays with fake timers.

Design Rationale

The lockfile previously selected loader 4.8.4 for installation and 4.6.0 for runtime loading. In an isolated reproduction using the CI image, installation succeeded but runtime loading missed the packaged native binary and selected the JavaScript fallback. Aligning the loaders restores native loading; the CI check makes a recurrence visible.

Retaining confirmation results handles late callers. Serializing refreshes prevents an older pending read from overwriting confirmed state. Longer timeouts would not fix either race.

Considerations

The Node version update stays in #1776, stacked above this PR. Test timeouts, worker counts, retry behavior and Lit Protocol code are unchanged. The loader resolution applies to this workspace's installation; it does not force downstream consumers' dependency resolutions.

Validation

  • An isolated frozen-lockfile install resolves loader 4.8.4 without changing the lockfile. Lifecycle scripts were disabled for this dependency check; the native installer was tested separately in the CI image.
  • In cimg/node:22.23.4, installation and native loading pass with no compiled addon present. Before the fix, the equivalent loader mismatch selected the JavaScript fallback.
  • With packaged prebuilds forced on, the three affected Request Client suites pass 103 tests on Node 22.23.4. Two localhost-dependent cases are excluded; one case is already skipped. All five cases from the latest CI failure are included and pass. Retry passes 9 tests.
  • On the prerequisite's existing Node 22.14.0 version, 31 selected declarative/confirmation tests pass.
  • TypeScript, formatting and YAML parsing pass. Production-file ESLint has no errors and 27 existing warnings. Fresh hosted checks remain pending.

UAT

After publishing the candidate SDK, create a permitted staging request. Wait for confirmation, call waitForConfirmation() again after it resolves, and confirm both calls return the confirmed request. Read the same request through a fresh client and confirm its ID, state and content match. Confirm the native-loading check and existing CircleCI suites pass.

Copy link
Copy Markdown
Contributor Author

@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no actionable issues were found.

Summary

This PR aligns node-gyp-build, checks native signature loading in CI, and preserves request creation results for late or repeated callers.

  • Request confirmation keeps its refreshed result for every caller.
  • CircleCI checks native signature loading with the workspace's 4.8.4 loader.
  • Retry delay tests use fake time instead of the wall clock.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Creation confirmed] --> B[Queue refresh]
  C[Earlier refresh] --> D[Earlier refresh settles]
  D --> B
  B --> E[Read current request data]
  E --> F[Emit confirmed]
  F --> G[Retain confirmation result]
  G --> H[Late and repeated waits receive result]
Loading

Reviews (1) · Last reviewed commit: "fix: load native signatures and preserve..." · Reviewed by Greptile

MantisClone commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Oct 30, 9:14 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 30, 9:14 PM UTC: @MantisClone merged this pull request with Graphite.

@MantisClone
MantisClone merged commit 434793d into master Oct 30, 2026
15 checks passed
@MantisClone
MantisClone deleted the fix/REQ-716-sdk-ci-confirmation branch October 30, 2026 21:14
MantisClone added a commit that referenced this pull request Oct 30, 2026
# Problem

The SDK still selects Node 22.14.0 locally and 22.14 in CircleCI, before the October security fixes. Tracked in [REQ-716](https://linear.app/requestnetwork/issue/REQ-716).

# Proposed Solution

Use Node 22.23.4 in `.nvmrc` and CircleCI. This PR changes only those two version selections.

# Design Rationale

The update stays within Node 22, which the SDK already supports through [PR 1595](#1595). Native-loader, confirmation and test corrections are separated into prerequisite [#1777](#1777).

# Considerations

Merge #1777 first. The [docker-images companion PR](RequestNetwork/docker-images#31) updates the gateway runtime separately; this PR alone does not patch a running gateway.

The planned normal release targets client SDK 0.66.0 and gateway 0.52.0. Installing the SDK does not upgrade a consuming application's Node runtime. Final package/image checks and staging request submission/readback remain required before production.

# Validation

With the prerequisite fixes, the three affected Request Client suites pass 103 tests on Node 22.23.4 using packaged native binaries. Two localhost-dependent cases are excluded; one is already skipped. Retry passes 9 tests. Native installation/loading also passes in `cimg/node:22.23.4` without a compiled addon. YAML parsing passes. Fresh hosted checks remain pending.

# UAT

Confirm the existing CircleCI build and test jobs pass on Node 22.23.4.
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.

3 participants