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

Closed
0x4007 opened this issue Aug 23, 2024 · 19 comments · Fixed by #297 or #311
Closed

ENS Fix #287

0x4007 opened this issue Aug 23, 2024 · 19 comments · Fixed by #297 or #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!

Copy link
Contributor

ubiquity-os bot commented Sep 22, 2024

[ 114.105 UUSD ]

@hhio618
Contributions Overview
View Contribution Count Reward
Issue Task 1 100
Issue Comment 6 14.105
Review Comment 1 0
Conversation Incentives
Comment Formatting Relevance Reward
Update: You can see that the name is now being resolved correct…
0.94
content:
  p:
    symbols:
      \b\w+\b:
        count: 14
        multiplier: 0.1
    score: 1
  img:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
multiplier: 1
0.5 0.47
@0x4007, I’ve successfully resolved your address. After looking …
2.83
content:
  p:
    symbols:
      \b\w+\b:
        count: 51
        multiplier: 0.1
    score: 1
  img:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
multiplier: 1
0.8 2.264
I suspect the caching issue might be happening here: https://git…
6.74
content:
  p:
    symbols:
      \b\w+\b:
        count: 90
        multiplier: 0.1
    score: 1
  pre:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
  code:
    symbols:
      \b\w+\b:
        count: 37
        multiplier: 0.1
    score: 1
multiplier: 1
1 6.74
I've created a video to showcase this in action. It's successful…
2.45
content:
  p:
    symbols:
      \b\w+\b:
        count: 43
        multiplier: 0.1
    score: 1
multiplier: 1
0.4 0.98
@0x4007, could you kindly take a moment to watch the video above…
2
content:
  p:
    symbols:
      \b\w+\b:
        count: 34
        multiplier: 0.1
    score: 1
multiplier: 1
0.3 0.6
I was able to reproduce the issue with the following steps: Nav…
3.39
content:
  p:
    symbols:
      \b\w+\b:
        count: 56
        multiplier: 0.1
    score: 1
  a:
    symbols:
      \b\w+\b:
        count: 4
        multiplier: 0.1
    score: 1
multiplier: 1
0.9 3.051
Resolves #287
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 2
        multiplier: 0
    score: 1
multiplier: 0
0.1 -

[ 63.273 UUSD ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Specification 1 58.84
Issue Comment 4 3.553
Review Comment 1 0.88
Conversation Incentives
Comment Formatting Relevance Reward
ENS is unreliable. There's two problems to fix: 1. Rate limitin…
58.84
content:
  p:
    symbols:
      \b\w+\b:
        count: 129
        multiplier: 0.1
    score: 1
  ol:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
  li:
    symbols:
      \b\w+\b:
        count: 2
        multiplier: 0.1
    score: 1
  pre:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 0
  code:
    symbols:
      \b\w+\b:
        count: 45
        multiplier: 0.1
    score: 5
  img:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 5
multiplier: 3
1 58.84
![image](https://github.com/user-attachments/assets/898e21c0-fd0…
2.7
content:
  p:
    symbols:
      \b\w+\b:
        count: 12
        multiplier: 0.2
    score: 1
  img:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 0
  pre:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 0
  code:
    symbols:
      \b\w+\b:
        count: 7
        multiplier: 0.2
    score: 1
multiplier: 1
0.1 0.27
My theory is that the resolver is crashing because my main ens n…
2.87
content:
  p:
    symbols:
      \b\w+\b:
        count: 23
        multiplier: 0.2
    score: 1
multiplier: 1
0.8 2.296
Only clearing cache? Seems unexpected as it is not a recycled re…
3.29
content:
  p:
    symbols:
      \b\w+\b:
        count: 27
        multiplier: 0.2
    score: 1
multiplier: 1
0.3 0.987
No I'm at a conference not on computer but you can check mine &#…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 14
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 1
- -
https://github.com/ubiquity/pay.ubq.fi/issues/287#issuecomment-2…
0.88
content:
  p:
    symbols:
      \b\w+\b:
        count: 13
        multiplier: 0.1
    score: 1
multiplier: 1
1 0.88

@0x4007
Copy link
Member Author

0x4007 commented Sep 22, 2024

image

Good job 👍

@hhio618
Copy link
Contributor

hhio618 commented Sep 23, 2024

@0x4007 Apologies for the inconvenience, but it seems the payout cannot be claimed.

@0x4007
Copy link
Member Author

0x4007 commented Sep 24, 2024

@0x4007 Apologies for the inconvenience, but it seems the payout cannot be claimed.

rndquu and I are working on this. We have to bridge over some more to Gnosis Chain, and set up some markets, to set the infrastructure up

@hhio618
Copy link
Contributor

hhio618 commented Oct 5, 2024

@0x4007 Payout still not working, it would be great to have possibility to collect this bounty in other available tokens like WXDAI.

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