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

chore: update codegen #83

Closed
wants to merge 4 commits into from
Closed

chore: update codegen #83

wants to merge 4 commits into from

Conversation

brunopgalvao
Copy link
Contributor

@brunopgalvao brunopgalvao commented Apr 25, 2024

If you get the following when trying to run the fund-dev-accounts script:

cargo run
   Compiling fund-dev-accounts v0.0.0 (/Users/bruno/src/pop-node/scripts/fund-dev-accounts)
    Finished dev [unoptimized + debuginfo] target(s) in 7.21s
     Running `/Users/bruno/src/pop-node/target/debug/fund-dev-accounts`
Error: Metadata(IncompatibleCodegen)

You can update the codegen for each respective chain by specifying the url:

subxt codegen --url ws://127.0.0.1:58043 | rustfmt > rococo_interface.rs
subxt codegen --url ws://127.0.0.1:58051 | rustfmt > pop_interface.rs

Source: https://docs.rs/subxt/latest/subxt/book/setup/codegen/index.html#the-cli-tool

@Daanvdplas Daanvdplas self-requested a review April 30, 2024 05:35
@Daanvdplas Daanvdplas self-requested a review April 30, 2024 12:50
Copy link
Collaborator

@Daanvdplas Daanvdplas left a comment

Choose a reason for hiding this comment

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

Still get the same error when running zombienet with relay v1.9.0

@brunopgalvao
Copy link
Contributor Author

Still get the same error when running zombienet with relay v1.9.0

Most likely you will need to re-run these commands and re-create the metadata:

subxt codegen --url ws://127.0.0.1:58043 | rustfmt > rococo_interface.rs
subxt codegen --url ws://127.0.0.1:58051 | rustfmt > pop_interface.rs

Then run again.

Anytime the runtime changes, which for us will be quite often because we are building Pop Network, then we will have to recreate the metadata with the above command.

@Daanvdplas
Copy link
Collaborator

Daanvdplas commented Apr 30, 2024

Most likely you will need to re-run these commands and re-create the metadata:

Also fails with relay v1.8.0 for me

@brunopgalvao
Copy link
Contributor Author

Also fails with relay v1.8.0 for me

Are you getting the error: Error: Metadata(IncompatibleCodegen)? If so you will need to re-run those commands properly.

Let's hop on a call when you are back and we can look into it.

@@ -4846,14 +4846,14 @@ dependencies = [

[[package]]
name = "jsonrpsee"
version = "0.21.0"
version = "0.22.4"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jsonrpsee is getting bumped here. I would not want the dependencies in this script to conflict with the dependencies of the pop-node.

One thought is to create a Cargo.toml within this project directory.

@Daanvdplas Daanvdplas closed this May 9, 2024
@Daanvdplas Daanvdplas reopened this May 9, 2024
@Daanvdplas Daanvdplas self-requested a review May 9, 2024 07:05
Copy link
Collaborator

@evilrobot-01 evilrobot-01 left a comment

Choose a reason for hiding this comment

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

I don't know that we need to bump subxt here. I just updated subxt-cli locally and used it to generate the updated interface, which is probably all it needs.

Suggest reverting the subxt bump in cargo toml and lock and then retesting to see if all still works.

@Daanvdplas
Copy link
Collaborator

Will test now

@Daanvdplas
Copy link
Collaborator

Getting this error when running the script,

Screenshot 2024-05-09 at 09 57 39

@brunopgalvao
Copy link
Contributor Author

I get the same error as Daan if I revert the subxt and subxt-signer to 0.34.0 on this branch and cargo build.

@brunopgalvao
Copy link
Contributor Author

brunopgalvao commented May 9, 2024

Two ways that I see this being solved:

  1. Specify versions in the script's Cargo.toml file
  2. Create a namespace for subxt and subxt-signer for this script

Example:

[dependencies]
[subxt]
version = "0.35.3"

[subxt-signer]
version = "0.35.3"

log.workspace = true
tokio.workspace = true

@brunopgalvao
Copy link
Contributor Author

Closing this. Re-open when we have a proper solution in-place for this.

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.

3 participants