fix: stabilize MPB bridge transaction history reads - #271
Conversation
Local validation after latest pushLatest pushed commit: Demo video: https://www.loom.com/share/ca5ef9ad275245fea142ffee278f6f68 What I validated locally:
Implementation notes:
Testing run:
Proof screenshots: |
|
Update after final local test and push:
Verification run locally:
Confirmation screenshot: Note: after several real bridge tests the wallet started showing insufficient CELO for gas; that is unrelated to this fix and happened only after the successful bridge flows depleted the test wallet gas balance. |
|
Addressed the latest review feedback in commit Changes:
Verification completed successfully: SDK and good-design TypeScript checks, targeted ESLint, 8 SDK tests, and the good-design transaction helper test. Thank you for the review. |
6096f6d
into
GoodDollar:copilot/fix-mpb-bridge-transaction-history
* Initial plan * chore: plan mp bridge history fix * fix: make mp bridge history sync reliable * chore: remove committed skills artifacts * docs: add bridge history sync comments * fix: stabilize MPB bridge transaction history reads (#271) * fix: stabilize MPB bridge history reads * fix: finalize MPB bridge history recovery * fix: handle transient MPB bridge block read errors * fix: polish MPB bridge transaction details * fix: address MPB bridge review feedback * simplify solution and shorten range --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Victor Edeh <edehvictor715@gmail.com> Co-authored-by: LewisB <laurence@gooddollar.org>
Closes #270
Addresses #268
Finalizes #269
Changes
provider.getLogscalls using max 500-block chunks.BridgeRequestandExecutedTransferto reduce RPC load.bridgeReadOnlyUrlssupport for MPB history reads, while preserving fallback to the existing app-level read-only provider setup.StaticJsonRpcProviderfor more stable network detection.Implementation Notes
The original issue expected independent per-chain reads. During local testing, public RPCs rate-limited heavily when too many requests were fired quickly, especially Celo public endpoints. The final implementation keeps chains isolated, but runs history RPC requests sequentially with a small delay and only for the active source/target route. This follows the later review guidance about slowing requests down and testing what public RPCs allow.
Each
eth_getLogsrequest remains capped at 500 blocks.Manual Verification
Validated locally in GoodProtocolUI using yalc/manual local package linking.
Environment used:
REACT_APP_NETWORK=production-celohttps://forno.celo.org,https://rpc.ankr.com/celo,https://celo.drpc.orgtatum,onfinality,1rpc,alchemyBridge flow tested:
10 G$from Celo to XDC via LayerZero.0x866075b684c5c9babd57501a99a25d60a36bb3072d054b2b9f53299417c0cc76Bridged via LayerZeroCelo -> XDC+10.00 G$Demo video: TODO - add video link here.
Testing
Passed:
The helper test result was:
Could not complete in this Windows PowerShell environment:
Reason: repo-wide CRLF/prettier warnings across many existing files in this Windows checkout. A targeted lint pass against the changed source files passed with
--quiet.Reason: both package build scripts fail before compiling because
dev:cleancalls Unixrm, which is not available in this PowerShell shell:The TypeScript compile steps from those packages were run directly and passed.
Remaining Risks
rmandyalcare available.Summary by Sourcery
Stabilize MPB bridge transaction history by switching to targeted log-based RPC reads, introducing per-chain error isolation, and wiring configurable read-only endpoints and chain scoping into the GoodDesign bridge UI.
New Features:
Bug Fixes:
Enhancements:
Tests: