Dapp spamming eth_getCode
DanielVF opened this issue · comments
I'm guessing it's a calculated proxy address for my new testing eth address, and there is not matching proxy. Total guess with no data.
@nick or @mikeshultz Any idea what could be causing this?
Low priority since it is not eating much of our Alchemy quota at all.
But would still be interesting though to understand better what's going on in case it starts causing more trouble...
@DanielVF probably hit the nail on the head. And "zero responses" are explicitly not cached because there were constant issues when proxy contracts were finally deployed and the dapp still falsely thinks it hasn't.
That said, that doesn't really mean the dapp needs to be polling this every second for new users. So perhaps that should still be investigated but these proxy checks are basically everywhere.
Ref:
https://github.com/OriginProtocol/origin/blob/master/packages/graphql/src/utils/proxy.js
https://github.com/OriginProtocol/origin/blob/master/packages/graphql/src/utils/memorize.js
I wonder why we are not seeing the same behavior on Mainnet?
Maybe the accounts/users in question already have proxies deployed.
I'm seeing the same behavior on Mainnet. For my account 0x428A1442113e833134CC564599C39Ab309ed565D it is querying ethGetCode for address 0xbeb7d9fd59e142e284fe096091502b3feeb56459
Bumped up the priority since it is not Rinkeby only and could ultimately lead to some queries getting rate limited by Alchemy.
0xBEb7d9fD59e142e284fE096091502B3fEEb56459
is the predicted proxy address for 0x428A1442113e833134CC564599C39Ab309ed565D
. It's some kind of identity query and you don't have a proxy yet.
Yep. With the new identity implementation that does not require a blockchain write, most users won't have a proxy (until they make an offer or create a listing). So this will likely impact large majority of new users.
On the DApp, we poll the wallet query every second.
https://github.com/OriginProtocol/origin/blob/master/dapps/marketplace/src/hoc/withWallet.js#L11
The query also requests proxy address.
https://github.com/OriginProtocol/origin/blob/master/dapps/shop/src/queries/Wallet.js#L15
That's the reason getCode
gets called every second.
I don't think MetaMask and a few other providers notify wallet address change through an event or subscription. That might be the reason polling was added. Not sure but @nick could confirm this.