Skip to content

refactor(evm): replace JSON ABIs with stable sol! interfaces#1575

Merged
ctrlc03 merged 1 commit into
mainfrom
chore/evm-stable-abi
Jun 4, 2026
Merged

refactor(evm): replace JSON ABIs with stable sol! interfaces#1575
ctrlc03 merged 1 commit into
mainfrom
chore/evm-stable-abi

Conversation

@hmzakhalid

@hmzakhalid hmzakhalid commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor

    • Consolidated contract interface definitions into a centralized module for improved code organization and maintainability.
  • Documentation

    • Minor formatting updates to configuration examples in operator documentation.

@hmzakhalid hmzakhalid requested a review from ctrlc03 June 4, 2026 09:43
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crisp Building Building Preview Jun 4, 2026 9:43am
enclave-docs Ready Ready Preview, Comment Jun 4, 2026 9:43am
enclave-enclave-dashboard Ready Ready Preview, Comment Jun 4, 2026 9:43am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5bc5c661-f0e5-41d9-8c2e-5c62acf6778d

📥 Commits

Reviewing files that changed from the base of the PR and between 4afd7f1 and 06a3ee9.

📒 Files selected for processing (14)
  • .github/workflows/releases.yml
  • crates/evm/src/actors/ciphernode_registry_sol.rs
  • crates/evm/src/actors/enclave_sol_writer.rs
  • crates/evm/src/actors/slashing_manager_sol_writer.rs
  • crates/evm/src/contracts.rs
  • crates/evm/src/domain/bonding_registry_events.rs
  • crates/evm/src/domain/ciphernode_registry_events.rs
  • crates/evm/src/domain/enclave_events.rs
  • crates/evm/src/domain/error_decoder.rs
  • crates/evm/src/domain/slashing_events.rs
  • crates/evm/src/lib.rs
  • crates/support/contracts/ImageID.sol
  • crates/support/tests/Elf.sol
  • docs/pages/ciphernode-operators/running.mdx

📝 Walkthrough

Walkthrough

This PR consolidates Solidity ABI contract interface definitions scattered across multiple modules into a centralized crate::contracts module. Four shared interfaces (IEnclave, ISlashingManager, ICiphernodeRegistry, IBondingRegistry) are defined once with complete event and error signatures, then imported by 8 consumer modules (3 actors, 5 domain layers) that previously generated local copies via alloy::sol! macros.

Changes

Contract ABI Consolidation

Layer / File(s) Summary
Central ABI contract definitions
crates/evm/src/contracts.rs, crates/evm/src/lib.rs
New contracts.rs module defines four stable Solidity ABI interfaces via alloy::sol!: IEnclave (with E3 struct), ISlashingManager, ICiphernodeRegistry, and IBondingRegistry. Module is registered in lib.rs with documentation noting that contract upgrades must preserve these exact signatures.
Actor layer consumer updates
crates/evm/src/actors/ciphernode_registry_sol.rs, crates/evm/src/actors/enclave_sol_writer.rs, crates/evm/src/actors/slashing_manager_sol_writer.rs
Three actor modules remove local sol! macro invocations and import shared interfaces from crate::contracts. Alloy sol import removed. Call sites continue using Interface::new(address, provider) pattern but now reference centralized definitions. slashing_manager_sol_writer.rs updates resolve_party_id_for_operator to use ICiphernodeRegistry instead of an in-function view interface.
Domain layer consumer updates
crates/evm/src/domain/enclave_events.rs, crates/evm/src/domain/ciphernode_registry_events.rs, crates/evm/src/domain/bonding_registry_events.rs, crates/evm/src/domain/slashing_events.rs, crates/evm/src/domain/error_decoder.rs
Five domain modules replace local sol! contract definitions with imports from crate::contracts. Alloy imports are streamlined to only LogData, B256, SolEvent. Event decoding and error selector references updated to use centralized interface types. error_decoder.rs tests updated to reference new error selectors from IEnclave, ICiphernodeRegistry, and ISlashingManager.
Minor formatting updates
.github/workflows/releases.yml, crates/support/contracts/ImageID.sol, crates/support/tests/Elf.sol, docs/pages/ciphernode-operators/running.mdx
GitHub Actions workflow job condition reformatted to single line. Solidity constant declarations re-emitted with updated formatting (no semantic change). Documentation YAML example quote style changed from double to single quotes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • gnosisguild/enclave#1574: Updates the same documentation file (docs/pages/ciphernode-operators/running.mdx) with related slashing_manager and fee_token contract configuration changes.

Suggested reviewers

  • cedoor
  • 0xjei

Poem

🐰 Scattered interfaces scattered no more,
One module now holds what was split before,
Eight files converge in a centralized place,
Contract ABIs with unified grace!
No more duplication, just truth to adore. 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the changeset: centralizing contract ABI definitions from JSON artifacts into stable Solidity interfaces in a new contracts module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/evm-stable-abi

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@ctrlc03 ctrlc03 merged commit 85f86a1 into main Jun 4, 2026
34 checks passed
@github-actions github-actions Bot deleted the chore/evm-stable-abi branch June 12, 2026 03:24
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