Skip to content
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: rust bindings #259

Merged
merged 9 commits into from
Jun 6, 2024
Merged

Conversation

merklefruit
Copy link
Contributor

@merklefruit merklefruit commented Jun 4, 2024

Description

Adds minimal rust bindings to the superchain registry package.

  1. Static files are embedded with the help of include_dir in the crate's binary
  2. They are loaded lazily as lazy_statics and exported for usage.

Ctor could be used alternatively of lazy_static, however I feel like lazy evaluation is an important feature and consider it preferable (and less experimental) than global constructors.

Tests

  • decode statically embedded files into the new superchain types
  • more tests are still needed to make sure everything is decoded properly

Metadata

bindings/rust/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. I think if we're able to pull in alloy types here, we should be good to get this merged and continue iterating on what's in trunk.

bindings/rust/src/init.rs Outdated Show resolved Hide resolved
@merklefruit merklefruit marked this pull request as ready for review June 5, 2024 21:52
@merklefruit merklefruit requested a review from a team as a code owner June 5, 2024 21:52
@merklefruit merklefruit requested a review from tynes June 5, 2024 21:52
Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I think it's reasonable to get this great start in trunk and keep iterating + adding tests.

Copy link
Member

@clabby clabby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Let's get final approval from @geoknee / @sbvegan, then I think we're good to merge :)

@refcell refcell merged commit a62fd38 into ethereum-optimism:main Jun 6, 2024
8 checks passed
@merklefruit merklefruit deleted the feat/rust-bindings branch June 6, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dep(superchain-registry): Rust bindings
3 participants