Skip to main content
improve wording
Source Link
Markus Schick
  • 1.3k
  • 5
  • 15

Most RPC Provider will enforce a gasLimit for eth_call as DOS Protection. For exampleinstance, Alchemy has a limit of 550 mio. and Infura has a limit of 300 mio.

I would suggest that youYou can create a view function that returnsretrieves the total number of organizations stored in the array and and another function that retrieves the entire array with multiple callsorganisations with a single call using multicall.

function numOrgs() public view returns(uint256) { return organisations.lenght; } function getOrganisations(uint256 idx) public view returns(Organisation memory) { return organisations[idx]; }   

With multicall you can batch calls to reduce the number of rpc requests.

Most RPC Provider will enforce a gasLimit for eth_call as DOS Protection. For example Alchemy has a limit of 550 mio. and Infura 300 mio.

I would suggest that you create a view function that returns the total number of organizations stored in the array and retrieves the entire array with multiple calls.

function numOrgs() public view returns(uint256) { return organisations.lenght; } function getOrganisations(uint256 idx) public view returns(Organisation memory) { return organisations[idx]; }   

With multicall you can batch calls to reduce the number of rpc requests.

Most RPC Provider will enforce a gasLimit for eth_call as DOS Protection. For instance, Alchemy has a limit of 550 mio. and Infura has a limit of 300 mio.

You can create a view function that retrieves the total number of organizations stored in the array and and another function that retrieves multiple organisations with a single call using multicall.

function numOrgs() public view returns(uint256) { return organisations.lenght; } function getOrganisations(uint256 idx) public view returns(Organisation memory) { return organisations[idx]; } 
Source Link
Markus Schick
  • 1.3k
  • 5
  • 15

Most RPC Provider will enforce a gasLimit for eth_call as DOS Protection. For example Alchemy has a limit of 550 mio. and Infura 300 mio.

I would suggest that you create a view function that returns the total number of organizations stored in the array and retrieves the entire array with multiple calls.

function numOrgs() public view returns(uint256) { return organisations.lenght; } function getOrganisations(uint256 idx) public view returns(Organisation memory) { return organisations[idx]; } 

With multicall you can batch calls to reduce the number of rpc requests.