-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expose some functions of frame-executive for building a custom executive easier #10711
Comments
Switch back to paritytech/substrate once paritytech/substrate#10711 is resolved
Switch back to paritytech/substrate once paritytech/substrate#10711 is resolved
@bkchr Any thoughts on this feature request? |
Collect and then? What you want to do with that? What happens at block production? |
Normally state root is collected after block execution, we also collect additional state roots after each transaction to make fraud proofs more efficient in our protocol. |
And you store them in the state? |
Currently yes |
I just have skimmed your code and the only change you made is the storage root calculation after If yes, adding some callback there should be enough for you? |
Nope. Not only after
Yeah, that should be enough, I need two hooks to run right after |
Ahh okay, yeah than adding some callback to these both and maybe after calling |
WDYT @shawntabrizi |
Ping @shawntabrizi |
A custom executive is required in Subspace, specifically, we would like to have a hook right after
initialize_block
andapply_extrinsic
to collect the intermediate storage root during the entire block execution.One idea is to create a wrapped pallet-executive on frame-executive, only copy a few functions(basically
execute_block
because it ties the initialize_block and extrinsic execution tightly) and make some modifications there, delegating all the other functions to frame-executive directly to minimize the maintenance of this custom pallet-executive. These functions just need to be made public in that way:substrate/frame/executive/src/lib.rs
Line 336 in 48e0b41
substrate/frame/executive/src/lib.rs
Line 411 in 48e0b41
substrate/frame/executive/src/lib.rs
Line 468 in 48e0b41
The another way could be some generic solution that is able to make the executive naturally more flexible to these custom needs, I haven't got a pretty clear idea though :P.
The text was updated successfully, but these errors were encountered: