-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building block specific metadata for each finalized block within the consensus. #73
Comments
@imyourm8 - I conferred with @shawntabrizi on this topic and he pointed out this PR, which removed a Finality Tracker pallet from our core |
Thank you @tomusdrw for pointing out this existing Issue, which is related to this topic, I believe paritytech/substrate#6742 |
@imyourm8 - can you please provide an update/response of whether or not the above resources are helpful? |
@danforbes Thank you for providing some information. Unfortunately, paritytech/substrate#7228 wasn't very helpful, I still don't know how I can possibly access block data after the finalization stage. Let's say we drop off-chain worker for a moment. Is there any way I can access the best block data after it has been finalized? |
Also, how can I modify block building logic? I want to take N block body bytes and add another N bytes as an extension, effectively doubling the block size. |
For now - we have decided to fork Substrate and modify its internals to meet our requirements. |
@imyourm8 I think we need a bit more details on what exactly your use case is. From what I understand you want to feed back on-chain processed finality information and you want this on-chain information to be verified by consensus as well. If the verification takes 12 seconds, then it naturally limits your block times. Such long block import times feel like an obvious DoS vector as well, cause I imagine this will vary heavily depending on the hardware. Now for the technical details:
I don't know if I understood your case correctly, but my best guess towards how this should be implemented is this:
You can also use Off-chain Workers instead of Let me know if that helps. |
Hey all - is this still an open issue? If so, let's reopen it. |
Short intro for what I am trying to accomplish:
Using Grandpa + Babe
Each block has a modified header (ideally) to include metadata-specific data for light clients to be able to query Full nodes for data to check if they indeed do have it.
A high-level algorithm looks like this:
There are a few problems with the whole process:
Myself, I checked a few options based on documentation:
Block import pipeline
That was the most obvious place to go, do it the last step right before the Client, but it seems like I can't access on-chain storage within it. Let's assume I can, will 12 seconds process break anything?
Offchain worker
That was my second obvious choice due to the fact, that it is automatically called after the block is finalized. But the function itself only accepts block number, and I can't get quick access to the block data there. Using RPC localhost call sounds a bit hacky and I would prefer direct access to on-chain data, if possible.
The other problem with offchain worker would be implementing custom slashing because the network must ensure, that metadata is built for each block, with no exceptions.
Is it possible to do all these using Substrate?
The text was updated successfully, but these errors were encountered: