JoshOrndorff / recipes

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

Recipe for inherents #91

Open JoshOrndorff opened 4 years ago

JoshOrndorff commented 4 years ago

Inherent extrinsics, are extrinsics that are injected into a block by the block author. Inherents are checked by other nodes in the network for general sanity constraints, but ultimately accepted as true because the author included them.

Here are some classic examples of inherents:

For this recipe, write a pallet that provides an inherent. A silly minimal example ould be for the block author to insert which day of the week the block was authored on. A more realistic, but more complex, example would be that second bullet point. Maybe the block author could enter the current water level in Lake Erie into the chain. Other nodes could do a sanity check by making sure the supplied value is similar to their own understanding.

JoshOrndorff commented 4 years ago

Examples from frame include timestamp and authorship. There is also the pow rewards module that is part of kulupu https://github.com/kulupu/kulupu/blob/master/rewards/src/lib.rs

herou commented 4 years ago

@JoshOrndorff I see that nobody is taking care of it. Can I? Please give me more info. Thank you.

herou commented 4 years ago

@JoshOrndorff Do not you receive notifications?

wheresaddie commented 4 years ago

yes, please run with this @herou we can support you if you have any questions and happy to check any PRs

JoshOrndorff commented 4 years ago

@herou Yes, I received the notification. I didn't answer yet because I was working out my priorities. It turns out that I will not be able to mentor this issue, but I have updated the issue description. You may try to tackle it and I will help where I can, but I can't provide active mentoring for this one anymore. I'm sorry.

jimmychu0807 commented 4 years ago

@herou If you are available, please feel free to make a PR for a inherent pallet (and even the text, to complete the recipe). I will help wherever I can and give review/feedback on the code and text.