Skip to content

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Aug 27, 2025

Description

to avoid request timeout on transaction not found case

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@mmsqe mmsqe marked this pull request as ready for review August 27, 2025 03:15
@mmsqe mmsqe requested review from a team as code owners August 27, 2025 03:15
@aljo242
Copy link
Contributor

aljo242 commented Aug 27, 2025

@mmsqe could you please provide more context here and link an issue?

Why do we not need the timeout here?

@mmsqe
Copy link
Contributor Author

mmsqe commented Aug 27, 2025

@mmsqe could you please provide more context here and link an issue?

Why do we not need the timeout here?

Just think we can let client side retry by itself, since now it retries not just transaction queued due to nonce gap case but also other transaction not found case. And even in nonce gap case, sender will also need to fill the gap to get the result before request timed out.

@vladjdk
Copy link
Member

vladjdk commented Aug 27, 2025

Just think we can let client side retry by itself

Default Forge scripts will not retry and will fail out on null responses from the JSON-RPC.

This can be tested with the following script on your branch:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "forge-std/Script.sol";

contract SimpleSendsScript is Script {
    function run() external {
        // Get deployer private key
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(deployerPrivateKey);

        console.log("Starting simple ETH transfers...");
        console.log("Sender:", deployer);
        console.log("Sender balance:", deployer.balance);

        // Create some recipient addresses
        address[8] memory recipients = [
                0x1111111111111111111111111111111111111111,
                0x2222222222222222222222222222222222222222,
                0x3333333333333333333333333333333333333333,
                0x4444444444444444444444444444444444444444,
                0x5555555555555555555555555555555555555555,
                0x6666666666666666666666666666666666666666,
                0x7777777777777777777777777777777777777777,
                0x8888888888888888888888888888888888888888
        ];

        uint256 sendAmount = 0.01 ether; // Small amount to send

        vm.startBroadcast(deployerPrivateKey);

        // Send ETH to multiple recipients
        for (uint i = 0; i <= 10000; i++) {
                payable(recipients[i%8]).transfer(1);
        }

        vm.stopBroadcast();

        console.log("\n=== Transfer Summary ===");
        console.log("Total transfers: 8");
        console.log("Amount per transfer:", sendAmount);
        console.log("Total sent:", sendAmount * 8);
        console.log("Remaining balance:", deployer.balance);
    }
}

At some point in the script, you'll be hit with a wall of responses like this and the script will fail:

Failure on receiving a receipt for 0xa415b350c674ca40de157790d04ead6ca9cf2a2564aadf52de11a521f5613057:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x4ff2d570bbe873c5d6cf621070f8a0fe4f8d098985c3546b2fbf55a9493448fe:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0xeca446b451c350816ce7aee7a2d8f3285428b61174c7ff01a7157dd74b00951f:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x331a19f48215869dd6569bb6931741327e120b3d41fda9da78c9912aadbb9bc9:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x6be26d064810fd51ded6cdfe75c47ead490fc3386e22f2a8e76fa01e933e98ba:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0xd0673200b4a673513f2f9d2e397a43dbc942b7ae84c8a0afdc04df2f7c2937ac:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x348baaf7abce9e82a0e91dfb19355eca1acfa8e7282502e12b159f526d3ae688:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x8f5008366b1483fa5729d9ad44fee6f2ec8120d6400b72f0064af65650880227:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x5d4b35b2363aa96bf989a962ba5a51c315c7c6de543d10426c6b80ffdfedf8d0:
server returned a null response when a non-null response was expected
Failure on receiving a receipt for 0x10b15cdf7514fb57bceae9246f6ab59b37fdb6ed8100e077db62eb15f232c897:
server returned a null response when a non-null response was expected

We can't outright remove this retry functionality, but what we can accept is an optimized way of fetching the transactions such that we get them quickly. Perhaps we can use event subscriptions here and await a response rather than polling multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants