Skip to content

feat(CHAIN-3336): add Rust bindings and reorganize bindings directory#200

Open
xenoliss wants to merge 7 commits intobo/chain-3335from
bo/chain-3336
Open

feat(CHAIN-3336): add Rust bindings and reorganize bindings directory#200
xenoliss wants to merge 7 commits intobo/chain-3335from
bo/chain-3336

Conversation

@xenoliss
Copy link
Contributor

@xenoliss xenoliss commented Mar 4, 2026

Summary

Reorganize contract bindings under a single bindings/ directory with language-specific subdirectories:

  • bindings/go/ — existing Go bindings (BalanceTracker, FeeDisburser) moved from bindings/
  • bindings/rust/ — new Rust bindings crate (base-contracts-bindings) using Alloy's sol! macro, moved from crates/bindings/

The Rust crate exposes typed bindings (ABI + bytecode) generated from committed Forge artifacts, so downstream Rust consumers can depend on it via Cargo without needing Foundry.

@linear
Copy link

linear bot commented Mar 4, 2026

Copy link
Contributor

@jackchuma jackchuma left a comment

Choose a reason for hiding this comment

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

There's no CI check or script to verify that committed artifacts in bindings/rust/artifacts/ match the current compiled output from forge build. If someone modifies FlashblockIndex.sol without regenerating the artifact, the Rust bindings will silently be out of sync.

Can we also add a CI step or a just recipe that:

  1. Runs forge build
  2. Compares forge-artifacts/FlashblockIndex.sol/FlashblockIndex.json with bindings/rust/artifacts/FlashblockIndex.json
  3. Fails if they differ

This would be analogous to the existing snapshots-check pattern

@xenoliss xenoliss requested a review from jackchuma March 4, 2026 16:49
Copy link
Contributor

@jackchuma jackchuma left a comment

Choose a reason for hiding this comment

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

We also probably want to add a CI step that confirms the generated rust bindings compile. What do you think?

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.

2 participants