Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENS Fix #287

Open
0x4007 opened this issue Aug 23, 2024 · 14 comments · Fixed by #297 · May be fixed by #311
Open

ENS Fix #287

0x4007 opened this issue Aug 23, 2024 · 14 comments · Fixed by #297 · May be fixed by #311

Comments

@0x4007
Copy link
Member

0x4007 commented Aug 23, 2024

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
Copy link
Contributor

hhio618 commented Sep 10, 2024

/start

Copy link
Contributor

ubiquity-os bot commented Sep 10, 2024

DeadlineTue, Sep 10, 3:03 PM UTC
Beneficiary 0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605
Tips:
  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.

Copy link
Contributor

ubiquity-os bot commented Sep 14, 2024

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

@hhio618
Copy link
Contributor

hhio618 commented Sep 14, 2024

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

@0x4007
Copy link
Member Author

0x4007 commented Sep 14, 2024

image

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

{"JSONRPC":"2.0","RESULT":"0X","ID":"1"}

@ubiquity ubiquity deleted a comment from ubiquity-os bot Sep 14, 2024
@0x4007 0x4007 reopened this Sep 14, 2024
@0x4007
Copy link
Member Author

0x4007 commented Sep 14, 2024

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

@hhio618
Copy link
Contributor

hhio618 commented Sep 15, 2024

@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
Copy link
Member Author

0x4007 commented Sep 15, 2024

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
Copy link
Contributor

hhio618 commented Sep 15, 2024

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
Copy link
Member Author

0x4007 commented Sep 15, 2024

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

@hhio618
Copy link
Contributor

hhio618 commented Sep 16, 2024

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!

ens-test.mp4

Copy link
Contributor

ubiquity-os bot commented Sep 18, 2024

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

@hhio618
Copy link
Contributor

hhio618 commented Sep 18, 2024

@0x4007, could you kindly take a moment to watch the video above? Additionally, I haven't been able to replicate the issue—would you be able to provide any further details that might help?

@hhio618
Copy link
Contributor

hhio618 commented Sep 19, 2024

image

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

{"JSONRPC":"2.0","RESULT":"0X","ID":"1"}

I was able to reproduce the issue with the following steps:

Navigate to the claim page, which populates the browser storage with JSON data from this file: query-reverse-ens.ts.
Update the code from this PR without clearing the cache; this will cause the JSON value to be displayed.
I'll add a commit to fix this as well!

@hhio618 hhio618 linked a pull request Sep 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants