optimistic-specs icon indicating copy to clipboard operation
optimistic-specs copied to clipboard

go: Better handle solidity bindings

Open trianglesphere opened this issue 2 years ago • 3 comments

We would like to address the following issues:

  • Ensure that the compiler version is deterministic and locked
    • We do this with solidity pragmas for version 0.8.10, but should be better
  • We want a CI check that ensures that if a contract changes, the go bindings also change
  • We may want to restructure where contract bindings are located / how they are built
    • The output oracle contract bindings are split from the opnode contract bindings requiring two makefile invocations
    • The opnode contracts are built in a specific folder. That makefile should probably be lifted to the main makefile (or we should add recursive make)

trianglesphere avatar Apr 11 '22 22:04 trianglesphere

foundry is supportive of adding forge bind go which would use abigen to build bindings

tynes avatar Apr 12 '22 16:04 tynes

The bindings have a separate go module now, with a single makefile, which is checked in CI to be equal to the bindings that are generated from the latest contracts: https://github.com/ethereum-optimism/optimistic-specs/pull/446

Aside from compiler-version locking I think this issue can be closed.

protolambda avatar May 16 '22 23:05 protolambda

The compiler version is locked by foundry, it's the version of abigen that is not locked. Currently we use latest, as the check in ci uses the master branch of geth to install abigen

tynes avatar May 17 '22 01:05 tynes