diyahir
February 15, 2024, 10:23am
1
Checking the bandwidth of my webapp, I am seeing that after changing to beta-5 I was being locked out of the rpc due to too many requests
No changes to logic, just bumping packages to beta-5 compatible, I see there are 3 times as many requests specifically on contract ‘simulations’ to get contract state queries
I can confirm that my code is not looping into it 3-4 times, and that the simulate call just sends out multiple requests
Each time, there are 2 duplicate ‘dry runs’ and then one ‘coins to spend’ rpc call
1 Like
Hey @diyahir , could you please confirm which version of fuels
you are using?
diyahir
February 15, 2024, 10:37am
3
using
yarn list --pattern fuel
├─ @fuel-ts/abi-coder@0.73.0
├─ @fuel-ts/abi-typegen@0.73.0
├─ @fuel-ts/address@0.73.0
├─ @fuel-ts/contract@0.73.0
├─ @fuel-ts/crypto@0.73.0
├─ @fuel-ts/errors@0.73.0
├─ @fuel-ts/forc@0.73.0
├─ @fuel-ts/fuel-core@0.73.0
├─ @fuel-ts/hasher@0.73.0
├─ @fuel-ts/hdwallet@0.73.0
├─ @fuel-ts/interfaces@0.73.0
├─ @fuel-ts/math@0.73.0
├─ @fuel-ts/merkle@0.73.0
├─ @fuel-ts/mnemonic@0.73.0
├─ @fuel-ts/predicate@0.73.0
├─ @fuel-ts/program@0.73.0
├─ @fuel-ts/providers@0.73.0
├─ @fuel-ts/script@0.73.0
├─ @fuel-ts/signer@0.73.0
├─ @fuel-ts/transactions@0.73.0
├─ @fuel-ts/utils@0.73.0
├─ @fuel-ts/versions@0.73.0
├─ @fuel-ts/wallet-manager@0.73.0
├─ @fuel-ts/wallet@0.73.0
├─ @fuel-ts/wordlists@0.73.0
├─ @fuel-ui/css@0.23.0
├─ @fuel-ui/design-tokens@0.23.0
├─ @fuel-ui/icons@0.23.0
├─ @fuel-ui/react@0.23.0
│ ├─ @fuel-ts/errors@0.71.1
│ ├─ @fuel-ts/math@0.71.1
│ └─ @fuel-ts/versions@0.71.1
├─ @fuel-wallet/react@0.15.2
├─ @fuel-wallet/sdk@0.15.2
├─ @fuel-wallet/types@0.15.2
├─ @fuels/assets@0.1.5
├─ @fuels/vm-asm@0.42.1
└─ fuels@0.73.0
1 Like
Thanks. We’ll look into this via:
2 Likes
Hello @diyahir . Can you give us the code that is resulting in these 3 times more requests?
It can help us to narrow down and find the bug more quickly.
2 Likes
diyahir
February 15, 2024, 12:11pm
6
let price = (
await oracle.functions
.get_price()
.txParams({ gasPrice: 1, gasLimit: 2000000 })
.simulate()
).value;
basically anything with simulate i see sending like 3-4 calls,
I can also push the webapp live and you guys look at it, but the code is currently closed sourced
1 Like
diyahir
February 19, 2024, 9:50am
7
FuelLabs:master
← FuelLabs:ns/feat/optimize-estimateTxDependencies
opened 04:24PM - 18 Feb 24 UTC
This PR:
- For a contract call, reduces the number of dry run calls before the … call from 4 to 1
- For a contract simulation, reduces the number of dry run calls before the simulation from 3 to 1
- Optimizes predicate estimation so that there are no calls to the node if all predicates in a transaction have been estimated
Besides the added tests, I verified that it works by spinning up a `create-fuels` app and linking to my local `fuels-ts` repo with this branch active, and then looking at the requests the app sends.
closes #1754
Looking through this PR, great work, appreciate the speed
Looking forward to the merge
2 Likes
The fix has been merged and should be released soon.
I’ll let you know when it’s out.
2 Likes
diyahir
November 13, 2024, 10:02pm
11
This is still an issue by the way each ‘get’ query starts with
getConsensusParametersVersion
getChainAndNodeInfo
estimateGasPrice
dryRun
This is causing a ton of strain on the RPC