Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export const publicClient = createPublicClient({
* Load-balanced RPC nodes may not have the receipt immediately after
* `waitForTransactionReceipt` completes on the client side.
*/
export async function getReceiptWithRetry(hash: Hex, maxAttempts = 3) {
export async function getReceiptWithRetry(hash: Hex, maxAttempts = 5) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
return await publicClient.getTransactionReceipt({ hash });
} catch (err) {
if (attempt === maxAttempts) throw err;
await new Promise((r) => setTimeout(r, attempt * 1000));
await new Promise((r) => setTimeout(r, attempt * 2000));
}
}
throw new Error("unreachable");
Expand Down
3 changes: 2 additions & 1 deletion src/components/DonateWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ export function DonateWidget({ storylineId }: DonateWidgetProps) {
setTxState("pending");
await publicClient.waitForTransactionReceipt({ hash });

// Trigger donation indexer
// Trigger donation indexer (delay for RPC propagation on Base Sepolia)
setTxState("indexing");
await new Promise((r) => setTimeout(r, 5000));
const indexRes = await fetch("/api/index/donation", {
method: "POST",
headers: { "Content-Type": "application/json" },
Expand Down
Loading