bosonprotocol / boson-dcl

Boson Protocol - Metaverse Toolkit - Decentraland SDK
Apache License 2.0
3 stars 0 forks source link

Random RPC errors when attempting MetaTransactions #14

Open mischat opened 1 year ago

mischat commented 1 year ago

Random RPC error occasionally prevents the metatransaction from occurring on commit

image1

Happens 1 approximately 8 times with any type of purchase

Occurs when metamask is set to Polygon, Ethereum or Polygon Mumbai (have not checked by changing scene config as suggested by James in this morning's meeting)

frankie13 commented 1 year ago

I added some debug and this seems to be coming from inside @bosonprotocol/core-sdk I can trace the issue to boson-dcl-v2/library/src/core-sdk.ts:189:

image

As you say, it seems intermittent, we can add some retry code around the call to coreSDK/erc20BalanceOf to address the issue if need be but might be cleaner to fix in @bosonprotocol/core-sdk.

How would you like to progress this?

Thanks!

mischat commented 1 year ago

@frankie13, i was looking at the repo, and it looks like we are using the public matic virgil RPC endpoints in the test scene, and I am guessing that these RPC endpoints are flaky, I was trying to Bridge on the polygon testnet, and their bridge was being flaky. Could you try passing your own, non-public, RPC endpoint in to see if this is still an issue, you can get a free RPC endpoint from INFURA for example ?

mischat commented 1 year ago

I am not sure that the right thing is to change the CORE sdk, having talked about it briefly with @levalleux-ludo. I guess i wouldn't mind @albertfolch-redeemeum's opinion too. But we feel like the core sdk shouldn' have such retry logic in it.

frankie13 commented 1 year ago

Thanks @mischat, yes I see what you mean. I will have a look at this today.

mischat commented 1 year ago

Am guessing you probably aren't hitting the their public rate limits, you would see 429's if so https://support.blockvigil.com/support/solutions/articles/67000346291-what-is-the-rate-limit-for-matic-rpc-

mischat commented 1 year ago

i was looking for a status page for matic virgil but i couldn't find one

frankie13 commented 1 year ago

@mischat I've just successfully put through 20 transactions in a row using my free polygon-mumbai alchemy endpoint. Looks like you're right about the flaky virgil RPC endpoints.