dappnetbby / eth-verifiable-rpc

Verifiable RPC for Ethereum state, in-browser, no node
https://hackmd.io/wAfo9dm9S0iMkaXWRIsYUw
ISC License
45 stars 3 forks source link

storageLoad Erroring Out #3

Open jim380 opened 1 year ago

jim380 commented 1 year ago
error: TypeError: Cannot read property 'value' of undefined
at VerifiableEthExecEnv.storageLoad (/xxx/node_modules/verifiable-eth-rpc/build/src/evm.js:187:45)

Seems to be persistent when using a paid Alchemy account. Out of 10 tries, only 1 would work if lucky. When it works, it works. Mostly fine when using Infura.

liamzebedee commented 1 year ago

Hey @jim380, can you provide some details so I can reproduce locally? Cheers

jim380 commented 1 year ago

@liamzebedee Hi Liam. You should be able to reproduce easily using Alchemy.

Also a sidebar question. Have you thought about turning this project into a local txn simulator? I built one using ethereumjs' VM library but eth-verifiable-rpc approaches it in a different way and I really like it.

liamzebedee commented 1 year ago

I'll try a repro when I get a spare moment this week.

@jim380 oh yeah! @shazow suggested this to me a few weeks back. It wouldn't be that difficult, happy to help out / guide you on how could could build it.

jim380 commented 1 year ago

@liamzebedee I actually built one using a much lower version of ethereumjs haha.

shazow commented 1 year ago

@jim380 Is yours public? Would love to check it out. :) It's on my list of things to prototype but not very high up the list right now. -_-

jim380 commented 1 year ago

@shazow I took the base from this repo, trimmed it down and tweaked some of the VM settings to make it all work for my needs (i.e. I was having nonce issues etc.). We can collab and make it better. Sound good? Cc: @liamzebedee too here.

A couple of things:

shazow commented 1 year ago

@jim380 I think that's how a lot of OSS code evolves, someone stumbles on a cool idea and makes a trimmed-down and tweaked version of it, shares it in public (preferably with a permissive license), then someone else stumbles on that... repeat, until we arrive at our Utopian future! :)

jim380 commented 1 year ago

@jim380 I think that's how a lot of OSS code evolves, someone stumbles on a cool idea and makes a trimmed-down and tweaked version of it, shares it in public (preferably with a permissive license), then someone else stumbles on that... repeat, until we arrive at our Utopian future! :)

I updated my original thread with the link to the repo I borrowed the idea from. Check it out.

jim380 commented 1 year ago

I have been running this simulator PoC against ethereum/polygon mainnet as a dry-run. By dry-run I mean that I catch the errors from the simulator itself and only log out the simulation result. This way the errors don't get bubbled up and mess up the critical code paths.

It mostly works but can be finicky at times. In my logs I would see bursts of failed simulations (i.e. successful simulations with failed results) due to either revert or out-of-gas, but the actual txns I broadcast to the network all went through.