ContractInteractor.js:437 Splitting request for 25116830 blocks into 2512 smaller paginated requests!

I’m trying to get GSN working on polygon mainnet.

But I’m stuck because ContractInteractor.js tries to make 2512 requests which is obviously taking forever.

RelayProvider.js:122 calling sendAsync{"jsonrpc":"2.0","id":13,"method":"eth_sendTransaction","params":[{"from":"0xXXXXXXXXXXXXXXXXXXXXXXX","data":"0xfb37e883000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000037361640000000000000000000000000000000000000000000000000000000000","to":"0x4e0a0353dd8ad4abb12cc25eff0462e918b412a8","maxPriorityFeePerGas":"0x9502F900","maxFeePerGas":"0x97e5afae"}]}
KnownRelaysManager.js:112 fetchRelaysAdded: found 6 events
KnownRelaysManager.js:121 fetchRelaysAdded: found unique relays: ["0x4fD765Ea4d6504d6A45A0B2C99f2A2dcE1aE8D8d","0x05c883c417b0e09925318E070dE220422665Ca86","0x555bBf8d0289E48E9AEB7603D45829C6349920c8","0xFaa9bcD55521741293d395841b3e5aD0491323Ec","0xA6BA2a432485b823341E924B82c49E1Be91cA1f0"]
ContractInteractor.js:437 Splitting request for 25116830 blocks into 2512 smaller paginated requests!

Here is how I initialize the RelayHub:

const config = {
          paymasterAddress: Config.paymaster,
          pastEventsQueryMaxPageSize: 10000,  // had to add that because Polygon limits that to 10k
          chainId: process.env.REACT_APP_CHAIN_ID,
          loggerConfiguration: {
            logLevel: "debug",
          },
        };
 const provider = await RelayProvider.newProvider({
     provider: window.web3?.currentProvider,
     config,
 }).init();

Any idea how to fix this?

See the suggested configuration parameters from Polygon Mainnet | Documentation

1 Like