-
Notifications
You must be signed in to change notification settings - Fork 114
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
feat: Support all OP Stack components #36
Comments
Before diving into building sharable code, we should review how we approach configuration. It's usually better to have a well defined config file format so that each client can then parse it using its own code rather than needing to embed a shared library. I'm not sure of the details of why we've got specific go code in this repo and it may be the right option but we should evaluate the options for making config available to alternate clients and not just dive into building reusable code. |
To have have a form that we can read and validate the configuration consistency of. E.g. address-format (checksums), completeness (missing references), and bytecode hashing are all tested with Go. And then it's better to expose the struct types publicly, so we do not have to duplicate them in the optimism monorepo or op-geth software. This doesn't have to be repeated for every language. As long as the raw config files can be embedded into the destination program of choice, then we don't need complete bindings. And these configs are not particularly performance-sensitive, we just need to keep the total data reasonably small (hence the bytecode deduplication and compression), to not blow up the binary size of op-stack applications. One approach to configs for all languages might be to expose just minimal bindings that expose the config as embedded filesystem (i.e. just a simple read-function by filepath). That way we can do releases/versioning of native package, but don't have to opinionate bindings or create types for every language. This might be as simple as defining a package definition file, that then exposes the config files as importable data (like in JS). Or alternatively, if the programming language of choice already can import a git repo efficiently and elegantly as dependency by git release tag, then we don't need any bindings for it at all. |
Which approaches will we choose? |
Can we add |
Is your feature request related to a problem? Please describe.
Currently, the alternative implementations of OP Stack components, apart from
op-erigon
andasterisc
, cannot take advantage of the superchain registry. This creates a sharded collection of chain configurations, where components likeop-reth
,magi
,hildr
,op-besu
,op-nethermind
,cannon-rs
, the Rust FPP, and whatever comes in the future that isn't written in Golang, cannot take advantage of this package.Describe the solution you'd like
Modularize the superchain registry such that it can be used by all OP Stack components, preparing for a future where our critical infrastructure is implemented in many more languages than just
Go
.Ideally, this means defining a core implementation, preferably in a language such as
C
,C++
, orRust
that is more friendly for interop, and then creating FFI bindings that enable several front-end APIs to be built for the library.We currently need support for:
Java
Rust
C#
Describe alternatives you've considered
superchain-registry
repository for each language that the OP Stack's core components are built upon. This would require a decent bit of duplicated code, increasing the possibility of divergent configuration between the implementations.Cgo
is a bit horrendous to work with when the direction is<language>
->Go
rather thanGo
-><language>
. It requirescbindgen
to embed Go types and semantics into the C header, etc. Rather than doing this, we should choose a more FFI friendly language that is closer toC
(or, evenC
/C++
itself) for the base implementation.Additional context
Modularizing the superchain registry will pay dividends in the future, offering a central, interoperable library for every OP Stack component to share the same configuration utilities.
The text was updated successfully, but these errors were encountered: