Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import pallet-evm & pallet-ethereum with default-features disabled. #1486

Open
vatsa287 opened this issue Aug 5, 2024 · 4 comments
Open
Labels

Comments

@vatsa287
Copy link

vatsa287 commented Aug 5, 2024

Question

I am trying to import pallet-evm & pallet-ethereum as below.

pallet-evm = { git = "https://github.com/polkadot-evm/frontier", default-features = false, branch = "polkadot-v1.11.0"}
pallet-ethereum = { git = "https://github.com/polkadot-evm/frontier", default-features = false, branch = "polkadot-v1.11.0"}

But it seems that even after setting default-features=false. It still pulls the underlying dependecies, example sp-io, frame-support etc. Which are already declared in my toml file with version v1.15.0.

I see in Cargo.lock that 2 names of packages exist, one of which is coming from here.

How to disable such flow?

Thanks.!

@boundless-forest
Copy link
Collaborator

You'd better not mix the dependencies in your repo, whether using GitHub branches or crate versions. I suggest changing all of them to GitHub branches, as I have never tested the crate versions yet.

@vatsa287
Copy link
Author

vatsa287 commented Aug 6, 2024

@boundless-forest Those are coming from Github branch of polkadot-sdk, not importing crates directly.

Many packages which are dependencies of pallet-evm are getting loaded again.

Example:

  error[E0152]: duplicate lang item in crate `sp_io` (which `frame_support` depends on): `panic_impl`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `sp_application_crypto` depends on)
    = note: first definition in `sp_io` loaded from /Users/vatsa/cord/target/release/wbuild/cord-braid-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-2ab5cbca6b12f779.rmeta
    = note: second definition in `sp_io` loaded from /Users/vatsa/cord/target/release/wbuild/cord-braid-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-f6db557f37b91e30.rmeta
    ```

@boundless-forest
Copy link
Collaborator

Would you be willing to share your code base? It's difficult to identify the issue based on the information provided above.

@vatsa287
Copy link
Author

vatsa287 commented Aug 6, 2024

@boundless-forest
https://github.com/dhiway/cord is the substrate based chain for which I am building Ethereum capability.
It is based on polkadot-v1.15.0 for all.

I have added below into root Cargo.toml

pallet-evm = { git = "https://github.com/polkadot-evm/frontier", default-features = false, branch = "polkadot-v1.11.0"}
pallet-ethereum = { git = "https://github.com/polkadot-evm/frontier", default-features = false, branch = "polkadot-v1.11.0"}

Then below into runtime's Cargo.toml dependencies and into std.

pallet-evm = { workspace = true, optional = true }
pallet-ethereum = { workspace = true, optional = true }

But not able to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants