This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Post-hook of block import in client #13927
liuchengxu
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Substrate provides the feature of subscribing to each imported block event which is typically considered as the completion of importing a block if I'm not wrong. However, we have the concept of domain block at Subspace which needs to run some special post-hook logics (generate and store the receipt of the imported block, etc) after the block is imported (by calling
client.import_block()
) which imposes a challenge: when the imported block notification from the client is out, the entire domain block import pipeline is not yet finished in theory due to the special post-hook logics, which is mostly okay in practice but I have encountered some hassles in the test environment.In short, I'm wondering if can we add a hook at a point which is after the block is imported into the database and before sending the notification of block imported so that the utility of BlockchainEvents can still be seamlessly used and generally make Substrate more flexible.
substrate/client/service/src/client/client.rs
Line 330 in 9a07e9d
Beta Was this translation helpful? Give feedback.
All reactions