JoshOrndorff / recipes

A Hands-On Cookbook for Aspiring Blockchain Chefs
GNU General Public License v3.0
376 stars 186 forks source link

OCW Recipe Rework #359

Closed jimmychu0807 closed 3 years ago

jimmychu0807 commented 3 years ago

@JoshOrndorff @danforbes @wheresaddie

todo:

JoshOrndorff commented 3 years ago

This is looking really good @jimmychu0807 I've added a few minor commits to satisfy the CI. Just a few small things to do to get it finished.

jimmychu0807 commented 3 years ago

@JoshOrndorff This is how it looks if we don't want conditional in service.rs: https://github.com/substrate-developer-hub/recipes/compare/jimmy/ocw-rework...jimmy/ocw-rework-no-cond?expand=1

But then the kitchen node will need to be depend on a pallet, to read the KeyTypeId keystore prefix constant for that pallet. wdut?

jimmychu0807 commented 3 years ago

Hmm, does --alice mean alice key can be found in every keystore, regardless of the keystore prefix? Let me try it out later

jimmychu0807 commented 3 years ago

I tried using --alice. It just add a session key and is not related to the ocw keystore. So back to this comment, either using a cond. compilation but the node doesn't depend on the pallet, or non-cond compilation but the node depends on the pallet to read the pallet keystore prefix.

I don't know which one is better. Having the node to depend on a pallet makes the pallet become a critical piece, and doesn't look like a good design choice.

@JoshOrndorff what do you think?

JoshOrndorff commented 3 years ago

@jimmychu0807 I honestly didn't even realize that ocw had a separate keystore. I'm fine leaving the conditional compile. Thanks for taking the time to explain that to me.