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

Looking forward to upgrade some pallets to frame v2 #454

Closed
herou opened this issue Jul 25, 2021 · 15 comments
Closed

Looking forward to upgrade some pallets to frame v2 #454

herou opened this issue Jul 25, 2021 · 15 comments

Comments

@herou
Copy link
Contributor

herou commented Jul 25, 2021

Hello,

I see that all the recipes still using frame v1, so I thought I could upgrade some of them to frame v2. The only issue that I have is when I import a pallet with v2 into kitchen-node I have these conflicts:
Any idea why it happens? What should I upgrade?
Screenshot 2021-07-25 at 16 26 49

@herou
Copy link
Contributor Author

herou commented Jul 26, 2021

Can you please take a look at this "issue": @JoshOrndorff @4meta5 @jimmychu0807 @danforbes @wheresaddie and let me know. Thank you!

@JoshOrndorff
Copy link
Owner

This is most likely some subtle issue in your cargo.lock file. I can probably help, but I'll need to see your code. Can you please push your branch to github?

@JoshOrndorff
Copy link
Owner

And FYI, of the people you mentioned, only @jimmychu0807 still works at Parity.

I'm happy to help you because I know you put a lot of effort into this repo previously which really helped me. Just wanted you to know the current state.

@herou
Copy link
Contributor Author

herou commented Jul 27, 2021

And FYI, of the people you mentioned, only @jimmychu0807 still works at Parity.

I'm happy to help you because I know you put a lot of effort into this repo previously which really helped me. Just wanted you to know the current state.

I am glad that you remember me :) Sad to hear that @danforbes left as well :/

@herou
Copy link
Contributor Author

herou commented Jul 27, 2021

This is most likely some subtle issue in your cargo.lock file. I can probably help, but I'll need to see your code. Can you please push your branch to GitHub?

Here it is: https://github.com/herou/recipes/tree/simple_event_frame_v2 I have added simple_event_v2 but it does not work.. Can you please take a look?

@JoshOrndorff
Copy link
Owner

JoshOrndorff commented Jul 28, 2021

I made a PR herou#5. Hopefully it will be helpful. The crux is that you always need to use the same exact Substrate version. You were using a newer version in your pallet, and the rest of the repo was still on an older version.

@herou
Copy link
Contributor Author

herou commented Jul 28, 2021

@JoshOrndorff I merged your PR but still having issues running the node :/

Can you please try to pull the branch and check if working on your local env?

Screenshot 2021-07-28 at 23 18 00

@JoshOrndorff
Copy link
Owner

Yeah, I also saw those errors. I didn't fix everything. I thought you were still working on them. Have you tried to figure out what those errors mean?

@herou
Copy link
Contributor Author

herou commented Jul 29, 2021

Yeah, I also saw those errors. I didn't fix everything. I thought you were still working on them. Have you tried to figure out what those errors mean?

If you take a look at this repo: https://github.com/herou/sub-examples/tree/simple-event-v2 it's the same pallet, but in this node, it works without any problem, so the issue is not on the pallet itself. I think the node, in this case, knows how to handle pallets v2. What I would like to archive is having the possibility to convert all the recipes(frame v1) to frame v2 and running them inside the current recipes node and later convert/upgrade the documentation as well. If you are still not clear please contact at: elioprifti@gmail.com

@JoshOrndorff
Copy link
Owner

In your sub-examples repo you are using one version of Substrate. This is the exact version you are using. https://github.com/herou/sub-examples/blob/simple-event-v2/Cargo.lock#L5219. The recipes is using a different version (3.0.0 as it is published on crates.io).

When you copied your code directly into the recipes you encountered two different types of problems both of which are caused by the Substrate version mismatch.

  1. Cargo noticed that you had used two different versions, and wouldn't let you build the project.
  2. There are some actual code differences between the two versions.

I solved the first problem for you by changing the Cargo.toml file that you copied in to use the same version as the rest of the recipes. Now you're encountering the second part.

So you have two options to get that pallet working in the recipes. You could change the pallet to use the same Substrate version as the recipes. This is the path that I started you down. OR you could update all of the recipes to use the Substrate version that your pallet uses.

I suspect changing your pallet will be quicker especially since I sorted the cargo part already. Updating the entire recipes would be a much more thorough learning experience.

@herou
Copy link
Contributor Author

herou commented Jul 29, 2021

@JoshOrndorff Can you be more descriptive? I am not familiar with this process and did not find any documentation explaining it.No idea how to do it, can you guide me? May I asking too much. Cargo.toml file of simple-event-v2 has the same dependencies versions compared to simple-event pallet. Which files should I compare?

@herou
Copy link
Contributor Author

herou commented Jul 30, 2021

@JoshOrndorff any idea?

@JoshOrndorff
Copy link
Owner

You're trying to use two different substrate versions. This is not supported. You need to choose one version and use it throughout your project.

@nukemandan does devhub have any learning resources or standard reply to explain the issue with mismatched substrate versions?

@herou
Copy link
Contributor Author

herou commented Aug 4, 2021

@JoshOrndorff Got you. Here: https://github.com/herou/recipes/tree/m1_fix_v3.0.0_all_pallets_disabled I have the recipes node and I have disabled all the recipes(pallets). I have added a pallet called pallet-template which uses frame v2. When I try to run the node only with pallet-template pallet I receive this issue:
Screenshot 2021-08-04 at 23 48 42

The reason why I disabled the other pallets is that they still use frame v1 so it would be impossible to have the node running because pallet-template uses frame v2 (as you explaining above). I just want to have this node running only with pallet-template. Do you have any idea why having this issue?
Screenshot 2021-08-04 at 23 56 31
pallet-template itself can be built without any problem. @JoshOrndorff

@herou
Copy link
Contributor Author

herou commented Aug 7, 2021

@JoshOrndorff because I was able to get it working and successfully converted simple-event pallet to frame v2 I will close this issue.

@herou herou closed this as completed Aug 7, 2021
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

No branches or pull requests

2 participants