ubiquity / pay.ubq.fi

Generate and claim spender permits (EIP-2612)
https://pay.ubq.fi
8 stars 35 forks source link

ENS Fix #287

Open 0x4007 opened 3 weeks ago

0x4007 commented 3 weeks ago

ENS is unreliable. There's two problems to fix:

  1. Rate limiting. Since it is some type of public ENS service, there are limits which I seem to have hit just for loading the page once. This happens occasionally where I see my address instead of the ENS resolving.
  2. Reverse resolver. This is considered the proper way to set your primary ENS, and at some point this doesn't render on the page correctly. Now it just grabs the first name you have from an array of all the ones you own. I own many, and it picks one consistently that is not my main.
Screenshot 2024-08-23 at 15 16 56
queryGraph @ https://pay.ubq.fi/bundles/bundles.js:72797
fetchEns @ https://pay.ubq.fi/bundles/bundles.js:72816
ensLookup @ https://pay.ubq.fi/bundles/bundles.js:72875
renderEnsName @ https://pay.ubq.fi/bundles/bundles.js:72893
renderTransaction @ https://pay.ubq.fi/bundles/bundles.js:72994

pay ubq fi__claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIyMTgwMDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiMTg4NjEwMDYwNTgwMDY3MDMzOTczMjM0Mz

hhio618 commented 1 week ago

/start

ubiquity-os[bot] commented 1 week ago
DeadlineTue, Sep 10, 3:03 PM UTC
Beneficiary 0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605
Tips:
<ul>
<li>Use <code>/wallet 0x0000...0000</code> if you want to update your registered payment wallet address.</li>
<li>Be sure to open a draft pull request as soon as possible to communicate updates on your progress.</li>
<li>Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.</li>
<ul>
ubiquity-os[bot] commented 4 days ago

@hhio618, this task has been idle for a while. Please provide an update.

hhio618 commented 3 days ago

Update: You can see that the name is now being resolved correctly here: qa

0x4007 commented 3 days ago

image

I don't know what this is but the deliverable is unacceptable

{"JSONRPC":"2.0","RESULT":"0X","ID":"1"}
0x4007 commented 3 days ago

My theory is that the resolver is crashing because my main ens name contains non utf8 characters. We need a more robust solution.

hhio618 commented 2 days ago

@0x4007, I’ve successfully resolved your address. After looking into the issue, it appears that if you're hard-coding the address parameter in the lookupAddress function, you may need to clear your browser cache. This could help ensure that outdated cached data isn't interfering with the lookup process. qa2

0x4007 commented 2 days ago

Only clearing cache? Seems unexpected as it is not a recycled response.

Before it resolved another ens. After merging your pull it resolves as a JSON object.

hhio618 commented 2 days ago

Only clearing cache? Seems unexpected as it is not a recycled response.

I suspect the caching issue might be happening here: https://github.com/hhio618/pay.ubq.fi/blob/de6d3988e3215a8ecbe5addf6d6a17ff4c08bf9e/static/scripts/rewards/cirip/query-reverse-ens.ts#L17

According to the ethers.js library, if a name isn't found, it should return null. Here's the relevant section of the code: https://github.com/ethers-io/ethers.js/blob/5aba4963e3e8ddfc912747076f5b7fe7a743cfe2/src.ts/providers/abstract-provider.ts#L1197

Could you please run the following snippet on your local configuration to see if it's returning the same json response or not?

import { ethers } from "ethers";

const provider = new ethers.providers.JsonRpcProvider("https://eth.api.onfinality.io/public");

provider
  .lookupAddress("0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605")
  .then((ens: string) => {
    console.log(`ens is ${ens}`);
  })
  .catch((error: Error) => {
    console.error("Error connecting to provider:", error);
  });
0x4007 commented 2 days ago

No I'm at a conference not on computer but you can check mine 0x4007CE2083c7F3E18097aeB3A39bb8eC149a341d

hhio618 commented 1 day ago

I've created a video to showcase this in action. It's successfully resolving both your UTF-8 ENS name and my ASCII ENS names. Please feel free to take a look!

https://github.com/user-attachments/assets/679a874d-9ecc-46cb-9ccc-ccf8e785c7dc

ubiquity-os[bot] commented 1 hour ago

@hhio618, this task has been idle for a while. Please provide an update.