Repository navigation
Conversation
…erification check Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
isConnected
|
@copilot Please extend this fix so failed wallets can actually recover, keeping it simple:
Please add focused tests for endpoint fallback, recovery on a later initialization attempt, and three failures producing one Slack alert while a healthy chain remains usable. Keep this scoped; no broad refactor. |
…itized Slack alert Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
Done in 192b78f: wallets now use the multi-RPC provider, and a failed wallet retries its init up to 3 times before sending one Slack alert. The new tests pass. The existing wallet tests against a local chain have not run: I couldn't start a chain here (the Solidity compiler download is blocked), and CI on this branch is waiting for maintainer approval.
Tests in the new
Decisions for you:
|
If
XdcAdminWalletfails to initialize (for example, its RPC is rate-limited), it never gets anidentityContract.MultiWallet.isConnectedchecks every wallet that has an Identity contract, so that one broken wallet makes the whole check throwCannot read properties of undefined (reading 'methods'). As a result, Celo/verify/topwalletfails in production even for accounts Celo has verified.Change:
Web3Wallet.isConnectedidentityContractis missing, log a warning (address, wallet name, network ID) and returnfalse. This replaces theTypeError.BaseAdminWallet.topWalletalso callsceloWallet.isConnected. If the Celo wallet itself is uninitialized, Base top-ups are now refused instead of throwing.MultiWallet.isConnectedcheck, as before. This PR does not add RPC fallback or retries.Tests:
blockchain/__tests__/multiWallet.test.js(new)Both tests leave XDC uninitialized and build the
MultiWalletwith stubbed Identity contracts:true, and the XDC warning is logged.false, so no top-up is authorized.Reviewer note (not addressed here)
The
MultiWalletconstructor makes the first wallet it visits themainWallet. JS orders integer-like object keys from lowest to highest, so with{122, ...{42220, 8453, 50}}that is XDC (50), not Fuse (122). This contradicts the// "main" wallet goes firstcomment. If confirmed,isVerified,lastAuthenticatedandgetAuthenticationPeriodcurrently run against XDC and would still fail when XDC is down. This likely needs its own issue.Summary by Sourcery
Make wallet initialization resilient to transient RPC failures while ensuring unavailable wallets are treated as unverified and do not disrupt healthy-chain verification.
New Features:
Bug Fixes:
Enhancements:
Tests: