Repository navigation
[GoodBounty]: Finalize MBPBridge refactor of tx history #270
Description
Summary
Pick up the existing AI-generated PR for MPB bridge transaction history reliability, run it locally, validate the full bridge flow, fix implementation gaps, clean up AI-written code, and prepare the PR for human review.
- Issue: [Bug]: MPB Bridge Transaction History does not load reliably #268
- PR: Refactor MP bridge history to chunked per-chain log sync #269
- Branch:
copilot/fix-mpb-bridge-transaction-history - Contributor role reference: https://docs.gooddollar.org/for-developers/contributing/open-source-contributors/contributor-role
Contributor task
- Claim the bounty with an ETA.
- Check out PR Refactor MP bridge history to chunked per-chain log sync #269 and run it locally.
- Compare the implementation against issue [Bug]: MPB Bridge Transaction History does not load reliably #268, the PR description, and repository patterns.
- Validate that the bridge history flow works against real or approved test RPCs.
- Fix concrete bugs in behavior, state handling, tests, typing, performance, or code quality. (specifically related to the transaction history. any other bugs in the flow should be raised as comment/async during testing/finalizig)
- Review code quality and simplify structure where the current AI-generated implementation is either too monolithic or over-split into low-value helpers.
- (not done yet): Add narrow bridge-specific curated RPC list support for MPB history reads, without restructuring the existing sdk-v2 provider architecture.
- Clean up unnecessary AI artifacts, comments, noisy logs, and unrelated changes.
- Provide a demo video showing the full flow working end-to-end.
- Leave a handoff comment with what changed, what was tested, evidence links, and remaining risks.
Scope checks
- The PR solves issue [Bug]: MPB Bridge Transaction History does not load reliably #268 requirements.
- The implementation follows the issue plan or explains any deviation.
- Existing SDK and design package boundaries are respected.
- Cached transactions render immediately on warm load.
- Empty cache triggers a 30-day backfill without any
eth_getLogsrequest over500blocks. - Non-empty cache fetches only from each chain cursor forward.
- Per-chain RPC failures do not block successful chains from rendering and updating cache.
- Loading, refreshing, empty, and partial-error states are distinct in the UI.
- A completed bridge action visibly triggers history refresh.
- Manual refresh works without remounting the hook.
- Pending vs completed bridge rows still merge correctly across
BridgeRequestandExecutedTransfer. - MPB history can use a curated bridge-specific RPC list, with fallback to the existing app-level
readOnlyUrls. - The curated RPC list is scoped to MPB bridge history reads and does not force a broad sdk-v2 provider architecture rewrite.
- Hooks/components are reviewed for responsibility boundaries: avoid one hook/component handling too much, but also avoid extracting one-line helpers that are only used once or twice and do not reduce complexity.
- Spending approval behavior is validated and fixed if stale allowance/approval state can cause skipped approval or stuck bridge execution.
- Desktop and mobile layouts are usable.
- PR description links the source issue and includes test evidence.
- The PR includes a demo video of the full flow.
Initial review notes
The PR appears to implement the intended direction:
- Replaces
useLogswith directprovider.getLogscalls inpackages/sdk-v2/src/sdk/mpbridge/hooks/useMPBBridgeHistory.ts. - Adds chunk generation and cache merge helpers in
packages/sdk-v2/src/sdk/mpbridge/hooks/useMPBBridgeHistory.helpers.ts. - Adds helper tests in
packages/sdk-v2/src/sdk/mpbridge/hooks/useMPBBridgeHistory.helpers.test.ts. - Adds UI refresh/error state in
packages/good-design/src/apps/bridge/mpbridge/TransactionHistory.tsx. - Calls
refreshHistory()after bridge success inpackages/good-design/src/apps/bridge/mpbridge/feature/useMPBBridgeViewController.ts.
Known review risks to validate:
- The 30-day backfill may produce many
getLogscalls across four chains and two event types; validate runtime, RPC rate limits, and user-facing loading behavior. - The current implementation uses providers from the global usedapp
readOnlyUrls; it does not add bridge-specific curated RPC support. (Missing and should add: support for rpcList for the bridge-flow) - The PR includes
.gitignorechanges for local agent artifacts; remove or justify if unrelated. - Spending approval behavior was flagged during review: after a previous per-transaction approval is consumed, the next bridge should re-check allowance and request approval when needed.
Additional implementation requirements
Code quality review
Review the AI-generated implementation for structure before requesting human review. The goal is simple, maintainable code:
- Do not leave one big hook or component responsible for unrelated concerns such as RPC fetching, cache persistence, event matching, UI state shaping, and display rendering.
- Do not overcorrect by moving trivial one-line expressions into helpers that are only used once or twice and do not clarify the code.
- Prefer extracting helpers only when they remove real complexity, reduce meaningful duplication, or create a unit that can be tested independently.
- Keep comments focused on non-obvious behavior; overly commenting is prefered
Bridge-specific curated RPC list
Add support for a curated RPC list used specifically by MPB bridge history reads. Keep this narrowly scoped.
Suggested simple approach:
- Add an optional prop near the high-level bridge entry point, likely
MPBBridgeController, for examplebridgeReadOnlyUrls?: Partial<Record<number, string>>. - Pass that value through the MPB bridge feature/view hooks only as far as needed by transaction history.
- Update
useMPBBridgeHistoryto accept an optional RPC override map, for exampleuseMPBBridgeHistory({ readOnlyUrls }). - When an override URL exists for a chain, create the read-only provider for that chain from the override and use it for
getLogs; otherwise keep the existing provider from app-level usedappreadOnlyUrls. - Keep the change single-purpose: do not redesign
Web3Provider,useReadOnlyProvider, or the wider sdk-v2 provider system unless there is no smaller working option.
The implementation should be deterministic enough for validation: the demo video and handoff notes must state exactly which RPC URLs were used for Fuse, Celo, Ethereum mainnet, and XDC.
Required commands
Run the relevant commands and include exact results in the PR handoff comment:
yarn
yarn lint
yarn workspace @gooddollar/web3sdk-v2 test packages/sdk-v2/src/sdk/mpbridge/hooks/useMPBBridgeHistory.helpers.test.ts --runInBand
yarn workspace @gooddollar/web3sdk-v2 build
yarn workspace @gooddollar/good-design buildIf a command cannot be run, document the exact command, failure output, environment, and whether the failure is pre-existing or introduced by PR #269.
Manual verification
Validate the MPB bridge screen with a connected wallet and supported source/target route.
- First open with empty cache performs a 30-day backfill and eventually renders history or a correct empty state.
- Second open with populated cache shows cached rows immediately (you need to do at least one transaction, funds can be shared once you are at this stage, ping @L03TJ3 ).
- Background refresh shows a visible refreshing state while keeping cached rows visible.
- Manual Refresh fetches from cached cursors forward.
- A new bridge transaction triggers history refresh after success.
- The new transaction appears as pending and later resolves to completed when the target event is available.
- One failing RPC/network does not prevent other chains from updating.
- No
eth_getLogsrequest exceeds500blocks.
-- Note: I have had a test where it was even denied saying 'cannot be more then 50 blocks'. I dont remember or saw clearly what RPC or what chain, but this is where the support for rpcList comes from. Should mainly rely for this flow on more well-known public rpcs per chain) - Curated bridge RPC URLs are used when provided, and the existing app-level
readOnlyUrlsremain the fallback. - Approval is requested when current allowance is insufficient for the transaction amount.
- The flow is usable on desktop and mobile viewport sizes.
Demo video requirement
Attach or link a demo video in the PR handoff comment. The video must show:
A single flow from doing a bridge > confirming the bridge and showing that the transaction history accurately updates.
Handoff comment
Please use the hand-off comment template found here: https://github.com/GoodDollar/GoodWidget/blob/main/docs/contributor-bounty-template.md#handoff-comment
Out of scope
- Do not redesign the bridge UI beyond what is needed for clear loading, refresh, error, and history states.
- Do not change bridge contract behavior.
- Do not broaden the task to unrelated bridge providers or unrelated SDK packages.
Activity
edehvictor commentedon Jul 2, 2026
GM @L03TJ. I'm an active contributor on the GoodDollar ecosystem. I have worked on couple of complex issues on projects across the ecosystem. I'd kindly request you assign this issue to be. I would resolve it with critically and submit PR that fixes it within 12-32HRS after assignment. Kindly consider.
L03TJ3 commentedon Jul 2, 2026
Okay, you got assigned @edehvictor
For testing locally!
yalc-- First you run
yarn install --immutable-- Then you go into sdk-v2 and run
yarn build-- then you go into good-design and do:
yarn install && yalc add -D "@"gooddollar/web3sdk-v2 (without quotes) && yarn build-- you ran
yarn install --immutable-- you run `yalc add "@gooddollar/good-design "@gooddollar/web3sdk-v2"
and run yarn install again.
You have already worked on GoodProtocolUI so I assume you have an .env file with approriate keys.
if something is not working, please let me know!
edehvictor commentedon Jul 3, 2026
Contributor: @edehvictor
PR: #271
Commit: c95b0f3
Fixed:
provider.getLogscalls with max 500-block chunks.BridgeRequest/ExecutedTransferfilters, log deduplication, cursor-based cache refresh, and 30-day cold-cache backfill.bridgeReadOnlyUrlssupport for MPB history reads, without redesigning the wider sdk-v2 provider architecture.Verified:
node .yarn\releases\yarn-3.2.1.cjs workspace @gooddollar/web3sdk-v2 exec tsc --noEmit: Passednode .yarn\releases\yarn-3.2.1.cjs workspace @gooddollar/good-design exec tsc --noEmit: Passed..\..\node_modules\.bin\jest.cmd src/sdk/mpbridge/hooks/useMPBBridgeHistory.helpers.test.ts --runInBand: Passed, 5 testsnode_modules\.bin\eslint.cmd --quiet <changed MPB history/design files>: Passed10 G$from Celo to XDC via LayerZero, and Recent Transactions rendered the completedCelo -> XDChistory row.0x866075b684c5c9babd57501a99a25d60a36bb3072d054b2b9f53299417c0cc76Evidence:
REACT_APP_NETWORK=production-celowith Celo RPCs tested/configured ashttps://forno.celo.org,https://rpc.ankr.com/celo, andhttps://celo.drpc.org.Bridged via LayerZero,Celo -> XDC, and+10.00 G$.Remaining risks:
rmandyalcare available. In this Windows PowerShell environment the package build scripts fail before compiling becausedev:cleancalls Unixrm.yarn lintis noisy in this Windows checkout because of repo-wide CRLF/prettier warnings across existing files; targeted lint on changed source files passed.