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

Impressive work #1

Open
0xClandestine opened this issue May 26, 2023 · 1 comment
Open

Impressive work #1

0xClandestine opened this issue May 26, 2023 · 1 comment

Comments

@0xClandestine
Copy link

0xClandestine commented May 26, 2023

Great work on this project! I've been contemplating a similar idea and I'm glad to see it materialize. I had a slightly different design approach in mind. Instead of deploying a contract and using revert for result propagation, I was considering utilizing something like HyVM for streamlined execution.

Flow:

  • Compress contract code.
  • Compressed code is stored as an immutable (or using SSTORE2).
  • Decompress code JIT and call the HyVM which supports returndata.

It's also worth noting that solady/LibZip.sol recently incorporated a FastLZ implementation.

Nonetheless, keep up the excellent work!

Best regards,
boredretard.eth

EDIT: Another idea was optimistic contracts where you simply store the initcode hash, callers would then provide the code which is hashed and compared, and once validated it would be forwarded to HyVM.

@merklejerk
Copy link
Owner

Thanks! Glad I'm not the only one thinking about this space.
I didn't know about solady's zip impl; will definitely check it out.

I also almost went with HyVM, which would likely work with staticcall() execution contexts. But I really wanted to maximze compatibility with existing contracts/workflows. It seemed like contracts would have to be deliberately written for a HyVM flow since calldata would always be empty, and probably other environmental differences (unless I'm misunderstanding).

Wrt the optimistic contracts, providing code is something you can technically already do with geth's eth_call state overrides so I don't think it would be worth going the extra mile of actually deploying anything if you take that approach. It also would be problematic for services that expect standardized functions, like opensea calling tokenURI().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants