Skip to content

Refactor: Move all precompiles into crates/{pallet}/precompiles/ folder#307

Open
danielbui12 wants to merge 3 commits into
devfrom
precompiles_refactoring
Open

Refactor: Move all precompiles into crates/{pallet}/precompiles/ folder#307
danielbui12 wants to merge 3 commits into
devfrom
precompiles_refactoring

Conversation

@danielbui12

Copy link
Copy Markdown
Member
  • Move the three pallet_revive precompile crates under crates/precompiles/, dropping the redundant -precompile directory suffix (package names unchanged)
  • Update workspace members and path dependencies in the root Cargo.toml

- Move the three pallet_revive precompile crates under crates/precompiles/, dropping the redundant -precompile directory suffix (package names unchanged)
- Update workspace members and path dependencies in the root Cargo.toml
- Update license-header globs and path references in CONTRIBUTING.md, CLAUDE.md, docs/design/smart-contracts.md, and examples/contracts/README.md
@danielbui12 danielbui12 self-assigned this Jul 22, 2026
@danielbui12
danielbui12 marked this pull request as ready for review July 22, 2026 12:21
@danielbui12
danielbui12 requested review from bkontur and ilchu July 22, 2026 12:22

@bkontur bkontur 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.

@danielbui12 I am checking, how we did precompiles in Polkadot SDK, and I would like to keep the same pattern here and align those:

  • Keep precompiles next to their pallet — in polkadot-sdk each precompile crate sits in a precompiles/ folder right beside the pallet it wraps (frame/assets/precompiles, frame/vesting/precompiles, xcm/pallet-xcm/precompiles), rather than all bundled in one central spot. If these belong to a specific pallet, popping them next to it keeps us consistent. (If they're genuinely standalone, a shared crates/precompiles/ is totally fine — just flagging the upstream habit.)
  • .sol location — upstream keeps the interface either at the crate root or in src/interface/ (like pallet-xcm/precompiles/src/interface/IXcm.sol). We're putting it straight in src/, so maybe move it to src/interface/I*.sol to match?

wdyt?

Everything else already matches nicely (package names, the lib.rs/mock.rs/tests.rs layout, etc).

@danielbui12

Copy link
Copy Markdown
Member Author

@bkontur I'm okay with it, let's follow polkadot-sdk pattern

- Relocate the three precompile crates from crates/precompiles/* to crates/pallets/*/precompiles/
- Move Solidity interface files into a src/interface/ subfolder and update the alloy::sol! paths
- Update workspace members and dependency paths in the root Cargo.toml
- Update directory references in CLAUDE.md, CONTRIBUTING.md, docs/design/smart-contracts.md, and examples/contracts/README.md
- Adjust licenserc.apache.toml include patterns for the new layout
@danielbui12
danielbui12 requested a review from eskimor as a code owner July 23, 2026 02:27
@danielbui12 danielbui12 changed the title Refactor: Move all precompiles into crates/precompiles/ folder Refactor: Move all precompiles into crates/{pallet}/precompiles/ folder Jul 23, 2026
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