f-o-a-m / purescript-web3

a purescript library for the web3 api
Apache License 2.0
127 stars 24 forks source link

Support latest cliquebait / geth v1.9 #151

Closed kejace closed 7 months ago

kejace commented 3 years ago

We had to use a tagged and older version of cliquebait to fix the build in #150 . The issue remains to support latest, as it seems to be bundling geth v1.9 and we want to support that

iostat commented 3 years ago

https://github.com/f-o-a-m/purescript-web3/issues/149#issuecomment-928057546

martyall commented 3 years ago

I'm guessing that geth has changed the way that it deals with accessing initialized storage. If you look at the test suite, there is really only one place where this failure could occur:

https://github.com/f-o-a-m/purescript-web3/blob/3258f302a4eb7887ab82428c5ca1bff1c4a2986a/test/web3/Web3Spec/Live/SimpleErrorTestSpec.purs#L39-L40

(As a side note, we should really write more tests to try different kinds of null storage errors. I could swear we used to have more in the purescript-web3-tests repo that just didn't get ported over)

My guess of what's happening is that geth used to not throw an exception encoded as 0xfe ~ MissingOpcode, but rather it used to return something f*ing dumb like 0x which we encoded as Left NullStorageError. Since it's now throwing an exception, assertWeb3 is picking that up in the response and rethrowing.

My proposal is that we add all kinds of new tests to see when NullStorageError is returned vs geth throwing an exception as 0xfe and try to get a handle on what the behavior is:

srghma commented 2 years ago

SimpleErrorTestSpec issue started after https://github.com/ethereum/go-ethereum/releases/tag/v1.9.15

martyall commented 1 year ago

@iostat hasn't this been done?

iostat commented 1 year ago

Yeah, we're testing against 1.9.x -- this issue is ancient. the 1.10+ thing should be a new issue, and is related to transaction formats

iostat commented 1 year ago

My hunch is the errors here are related to how solc compiles reverts -- or how geth is interpreting revert behavior and the fact that we use an older solc in the tests.