erigontech / erigontech/erigon
[shutter] work towards better lib re-use with shutter team
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.5k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 455
Description
Currently I've ported over 3 main parts from the shutter team repos that ideally I would like to just import as libraries:
- `erigon/txnprovider/shutter/internal/crypto` - instead of `shutter-network/shutter/shlib`
- shlib has a go-ethereum dependency and it will bring in go-ethereum transitive dependency in erigon
- looks like the go-ethereum dependency may be possible to be removed without much friction
- `shlib/shcrypto/shbls` has some go-ethereum dependencies but can be removed since I couldn't find any usages of this package in other shutter-network repos (need to double check this thoroughly)
- `shlib/shcrypto` has go-ethereum dependency that relies on `hexutil.Bytes` and `common.HexToBytes` - these are quite straightforward and small packages that we can potentially organise better in `erigon-lib` as separate go submodules with their own `go.mod` files - we can then ask shutter-network to depend on these much smaller and concise packages
- this one is highest priority to re-use as a lib
- `erigon/txnprovider/shutter/internal/proto` - protobuf definitions and generated code - the shutter guys have that in `shutter-network/rolling-shutter/p2pmsg` package but it is not exposed as a sub module (it needs its own `go.mod` and then we can depend on it in Erigon) - ask them if they will be happy to do it or we can make a contribution ourselves
- `erigon/txnprovider/shutter/internal/contracts` - instead of `shutter-network/contracts`. This contains smart contracts needed for the shuttered validator - right now I've had to copy over the .sol files -> compile them into .bin files -> use our own `abigen` to generate bindings so that I don't introduce go-ethereum dependencies coming from the fact that the shutter team have used go-ethereum's abigen to generate the bindings. Instead we should just ask for a gitsubmodule repo approach of the .sol files that we can plug into our repo and do the abigen bindings using our own abigen. It looks like they previously had that (e.g. https://github.com/shutter-network/gnosh-contracts) but they've deprecated that in favour of `shutter-network/contracts` which introduces go-ethereum transitive dependency.
Contributor guide
Assessment
This issue has not been assessed yet.