refactor(fault-proof): use forge-generated bindings as ABI source of truth#809
Open
fakedev9999 wants to merge 1 commit into
Open
refactor(fault-proof): use forge-generated bindings as ABI source of truth#809fakedev9999 wants to merge 1 commit into
fakedev9999 wants to merge 1 commit into
Conversation
Contributor
|
ccff389 to
34deffe
Compare
…truth - Replace hand-written sol! ABI definitions with forge-generated bindings from op-succinct-bindings for contract types used in fault-proof and host - Keep hand-written sol! only for enums (GameStatus, ProposalStatus) that need custom derives and proper Rust enum variants - Move shared L2Output struct to bindings crate, re-export from consumers - Commit generated codegen to git so forge-less environments (Docker, CI jobs without Foundry) can compile against the bindings - Restore graceful forge fallback in build.rs: skip regeneration when forge is not in PATH, bail only if forge is present but broken - Add --skip-extra-derives to forge bind: removes unused serde/Debug/Default derives from codegen, reducing compile time - Add .gitattributes to collapse generated code in GitHub PR diffs - Hoist ProposalStatus::try_from before match block in proposer.rs
34deffe to
52dc0db
Compare
3 tasks
fakedev9999
added a commit
that referenced
this pull request
Apr 28, 2026
…891) The Solidity source returns Duration (= uint64) for both maxChallengeDuration() and maxProveDuration(), but the hand-written sol! binding declared uint256 for the former. The wire ABI was unaffected (32-byte word either way), and the call site narrowed the result back to u64 with .to::<u64>(), so no production behavior changes — but the type-level binding now matches the contract. Reported by Kien Nguyen. PR #809 supersedes this fix by replacing all hand-written sol! bindings with forge-generated ones, eliminating this class of drift.
fakedev9999
added a commit
that referenced
this pull request
Apr 28, 2026
…891) (#893) The Solidity source returns Duration (= uint64) for both maxChallengeDuration() and maxProveDuration(), but the hand-written sol! binding declared uint256 for the former. The wire ABI was unaffected (32-byte word either way), and the call site narrowed the result back to u64 with .to::<u64>(), so no production behavior changes — but the type-level binding now matches the contract. Reported by Kien Nguyen. PR #809 supersedes this fix by replacing all hand-written sol! bindings with forge-generated ones, eliminating this class of drift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sol!ABI definitions with forge-generated bindings fromop-succinct-bindingsfor contract types used in fault-proof and hostsol!only for enums (GameStatus,ProposalStatus) that need custom derives and proper Rust enum variantsL2Outputstruct to bindings crate, eliminating duplication between fault-proof and host-utilsbuild.rs: skip regeneration when forge is not in PATH, bail only if forge is present but broken--skip-extra-derivestoforge bind: removes unused serde/Debug/Default derives from codegen, reducing compile time.gitattributesto collapse generated code in GitHub PR diffsProposalStatus::try_frombefore match block in proposer.rs, eliminating 3 duplicate conversionsTest plan
cargo fmt --all -- --check— no diffscargo test -p op-succinct-fp— 12 tests passcargo check -p op-succinct-bindings— compiles without serde depgrep -r "serde::Serialize" bindings/src/codegen/— 0 matches (extra derives removed)git ls-files bindings/src/codegen/— 16 tracked filescargo check -p op-succinct-fp— compiles using committed codegen