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

Precompile that exposes execution-node's API #208

Closed
halo3mic opened this issue Feb 25, 2024 · 6 comments
Closed

Precompile that exposes execution-node's API #208

halo3mic opened this issue Feb 25, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@halo3mic
Copy link
Contributor

Describe the feature you would like

A precompile that exposes execution-node's API. For starters eth namespace would be enough.

Afaik now one needs to call external node to get the latest block or account balance, this seems unnecessary as there is a local node running alongside SUAVE.
It is true that some values could be obtained by eth_call to a contract exposing block API (like the Maker's MulticallV2), but this again seems more convoluted that it should be.

Additional context

No response

@lthibault
Copy link
Contributor

In principle, could this be achieved using SUAVE's HTTP precompile? It seems like it would be a straightforward matter of providing you with the execution node's URL, and then leaving it up to you to perform JSON-RPC requests.

(cc @ferranbt)

@halo3mic
Copy link
Contributor Author

halo3mic commented Feb 26, 2024

I guess this would work if you know the port of the execution node. But not sure how cautious one should be with directly exposing the local node.

@lthibault
Copy link
Contributor

Agreed. I'm going to bring this up with the team and get back to you.

@lthibault
Copy link
Contributor

@halo3mic so the issue is that we don't want to leak the node's IP:PORT tuple, as it exposes us to DoS. However, I believe this recently-added feature would satisfy your requirement.

Instead of

string memory httpAddr = Suvve.resolveDns("goerli")
Suave.httpRequest({.... addr: httpAddr})

You would do something like Suave.httpRequest({... addr: "goerli"}).

@halo3mic
Copy link
Contributor Author

@halo3mic so the issue is that we don't want to leak the node's IP:PORT tuple, as it exposes us to DoS. However, I believe this recently-added feature would satisfy your requirement.

Instead of

string memory httpAddr = Suvve.resolveDns("goerli")
Suave.httpRequest({.... addr: httpAddr})

You would do something like Suave.httpRequest({... addr: "goerli"}).

Oh cool! This seems like it resolves the issue

Do you think this still exposes the execution node to ddos - you can do CCR using this new feature without any cost (if MEVM execution fails no gas is paid)?

@lthibault
Copy link
Contributor

Do you think this still exposes the execution node to ddos - you can do CCR using this new feature without any cost (if MEVM execution fails no gas is paid)?

I believe you are correct, though this is on our list of things to figure out "in the future". Off-the-cuff, gating this through a CCR allows us to do things like load balancing, or possibly introducing some sort of gas tax. TBD.

Glad this fixes the issue! 🙂

@lthibault lthibault self-assigned this Feb 26, 2024
@lthibault lthibault added the enhancement New feature or request label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants