-
Notifications
You must be signed in to change notification settings - Fork 1
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
Batch gateway #1
base: main
Are you sure you want to change the base?
Conversation
|
||
``` | ||
contract OffchainResolver is IExtendedResolver, ERC165, OffchainMulticallable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?? What is this supposed to show the user?
- Encode `resolver(dnsname, addrData)` into `callData` | ||
- Combine `callData` into the array of `callDatas` | ||
- Call `offchainResolver.multicall(callDatas, {ccipReadEnabled:true})` with CCIP-read feature enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you could use it like this, but the intention was that the main use case would be for things like the universal resolver to use the batch gateway, transparently to user code.
|
||
const IResolverService = new ethers.utils.Interface(IResolverService_abi); | ||
|
||
function getDnsName(name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you import mafintosh/dns and use name.encode
, or at least copy the code here?
name: chainName, | ||
ensAddress, | ||
}); | ||
(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to replicate a lot of the functionality of the universal resolver. Why not just use that?
})).then((values) => { | ||
// reject non 200 responses | ||
// @ts-ignore | ||
return values.filter(v => v.status === 'fulfilled').map((v:any) => v.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if all the gateways return non-200 responses?
const sender = request.to; | ||
let responses = await Promise.all( | ||
data.map((d: any) => { | ||
return Promise.allSettled(d.urls.map((url: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure we want to query them all in parallel? This could result in serious query amplification / DoS issues.
const host = 'https://example.com' | ||
const host2 = 'https://example2.com' | ||
const response = GatewayI.encodeFunctionResult('query', [[1]]) | ||
describe('makeServer', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an E2E test using Ethers?
@Arachnid as discussed, I tried to move
Ideally b.3 should call with
|
You're right, you will need to modify the batch gateway interface to include the |
@Arachnid |
I left a comment, but I don't understand how it would help here? |
@Arachnid Can you comment about ensdomains/ens-contracts@53679f6#r82792383 so that you get notification on the conversation |
Solving ensdomains/offchain-resolver#17
Dependencies