Add websocket transaction confirmation - #4859
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
Claude finished @ponderingdemocritus's task —— View job PR Review: Add websocket transaction confirmationTasks:
SummaryThis PR adds an optional WebSocket-based transaction confirmation strategy to Breaking Changes / Backward CompatibilityNo breaking changes detected. The fourth constructor argument accepts either the old API Consistency
addEventListener?: (event: string, listener: (...args: any[]) => void) => void;This leaks
Type Safety
return "retryConfig" in value || "transactionConfirmation" in value;A
export const TX_WAIT_SUCCESS_STATES: TransactionFinalityStatus[] = [
"PRE_CONFIRMED" as TransactionFinalityStatus,
...This suggests Error HandlingWebSocket connection is cached across calls but never re-established on permanent failure. In
Build & Distribution
Test relies on private class name via expect((provider as any).transactionReceiptWaiter.constructor.name).toBe("PollingTransactionReceiptWaiter");Class names are not guaranteed to survive minification, and accessing private internals by name is fragile. Exposing a narrow Minor / Nits
Overall AssessmentThe core design is sound: clean strategy pattern, clear fallback, proper cleanup with
|
|
Claude finished @ponderingdemocritus's task —— View job PR Review: Add websocket transaction confirmationTasks:
SummaryThis PR adds a WebSocket-based transaction confirmation strategy to Security & SecretsNo issues found. No secrets, API keys, or private keys are committed. The The Reliability & CorrectnessMedium — WebSocket connection is never explicitly closed
Recommendation: In Low —
Recommendation: Explicitly reject the pending subscription when a terminal failure status ( Low — Request ID counter is per-connection, not per-class
Multi-Environment ConsistencyNo issues. The Dependency ManagementLow —
The Test CoverageThe test file (
Missing test cases:
Code Quality
VerdictApprove with minor suggestions. The core design is sound, the implementation is clean, and the backwards-compatibility handling is correct. The primary concern is the missing connection reset on socket close which can cause silent hangs for subsequent transactions after a connection drop. The rejection of failure statuses is a secondary reliability issue worth addressing before wider rollout on Mainnet. |
|
Failed to generate code suggestions for PR |
Adds an internal transaction confirmation strategy for
packages/providerthat can use Starknet websocket transaction-status subscriptions when awsUrlis configured, while preserving polling as the default and auto fallback path.The provider constructor now accepts either the legacy retry config or an options object with retry and transaction confirmation settings.
The websocket waiter subscribes to transaction status, treats
PRE_CONFIRMED,ACCEPTED_ON_L2, andACCEPTED_ON_L1as success states, fetches the receipt once, and leaves existing revert/background confirmation handling intact.Validation:
CI=1 pnpm --filter @bibliothecadao/provider test,pnpm --filter @bibliothecadao/provider build,pnpm run format, andpnpm run knip.