JoshOrndorff / recipes

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

OCW pallet is unintuitive with instant seal #318

Open JoshOrndorff opened 4 years ago

JoshOrndorff commented 4 years ago

When the ocw runtime is installed in the kitchen node (which uses instant seal) there is correct, but unintuitive behavior that a user must send a single transaction manually in order to get the first block authored. After that, the OCW will send a transaction that authors the next block and the chain will continue forever.

This behavior is correct for both instant seal and the OCW runtime, but it can be confusing for users. Thus I recommend a warning at the beginning of the OCW writeup saying something like this:

This pallet executes an offchain worker after each block. If you are using it with a consensus engine that does not author on a regular basis, like instant seal in the kitchen node or manual seal in the manual seal node, you will need to send one transaction manually to start the chain of transactions. This behavior is correct, but perhaps unintuitive.

JoshOrndorff commented 4 years ago

This will be addressed when it is addressed upstream in Substrate. See https://github.com/paritytech/substrate/issues/6849