Repository navigation
[smr-moonshot#4924] Publish bindings of the Supra precompile interfaces - #104
Merged
Merged
Conversation
Generate alloy `sol!` bindings for ISupraBlockTimestamp, ISupraRandomness, ISupraNativeCrossing and ISupraEvmGasConfig from the JSON ABIs the build script compiles, and export them as `supra_contract_bindings::precompiles`, so the node that implements the precompiles takes their selectors and event signatures from the Solidity interfaces instead of its own transcription of them. Tests pin every function selector, custom-error selector and event topic to its `solc --hashes` value, the exact set each interface declares, the indexed layout of each event and the return type of each entry point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isaacdoidge
approved these changes
Dec 3, 2026
Author
|
Node side: Entropy-Foundation/smr-moonshot#5405 (stacked on smr-moonshot#5341) re-exports these bindings in place of the node's own |
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
Publishes Rust bindings of the four Supra precompile interfaces from
revm-supra-extension, assupra_contract_bindings::precompiles:ISupraNativeCrossingISupraNativeCrossing.sol0x…53555002ISupraRandomnessISupraRandomness.sol0x…53555003ISupraBlockTimestampISupraBlockTimestamp.sol0x…53555004ISupraEvmGasConfigISupraEvmGasConfig.sol0x…53555005Each is
alloy::sol!over the JSON ABI the build script already compiles fromsolidity/supra_contracts/src/interfaces/(the same mechanism asSupraContractsBindings), withall_derives.Motivation
V6-4 of Entropy-Foundation/smr-moonshot#4924. The node implements these precompiles. Until now it declared each interface again in its own
sol!block, and nothing checked that declaration against the Solidity file. With these bindings, the interface a contract imports and the selectors the node answers both come from the same.solfile. The node-side change is Entropy-Foundation/smr-moonshot (stacked on smr-moonshot#5341, which moves the node tofeature/revm-43-sync). It drops the node's foursol!blocks and re-exports these bindings.Changes
crates/supra-extension/src/supra_contract_bindings/precompiles.rs(new): the four bindings. Its hand-written docs turn the rustdoc lints back on, which the parent module relaxes for macro output.supra_contract_bindingsis nowpub.supra_contracts_bindingsis nowpub(crate); its items remain re-exported from the crate root as before.crates/supra-extension/tests/precompile_bindings.rs(new), 8 tests that check:solc --hashesvalue and against the keccak of its signature;Precompile addresses stay with the node. The table in the module doc is for reference only.
Known follow-up:
feature/revm-43-syncdoes not yet carrycrossingGasCost()(added toISupraNativeCrossing.solonfeature/evm_automation, #101). When that reaches this branch, the exact-set test forISupraNativeCrossingneeds the new selector.Test plan
cargo test --release -p revm-supra-extension --test precompile_bindings: 8/8cargo clippy --release -p revm-supra-extension --all-targets -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --release -p revm-supra-extension --no-depscargo +nightly fmt --checkcast sig/cast keccakfrom the.solsources🤖 Generated with Claude Code