-
Notifications
You must be signed in to change notification settings - Fork 486
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
populate parent hash for indexers #1044
populate parent hash for indexers #1044
Conversation
It's a bug if currently parent hash is not populated other than genesis block. |
Some basic testing didn't reproduce the issue for me. Appreciate it that you can submit a bug report issue with more details of exactly which situations you are not getting the parent hashes. This PR is definitely not the right way though. |
@sorpaas this is an old patch we need to have in our fork to solve the bug that was introduced in #570 (context explained there). So is a patch to fix, at most, a single block. Basically means that, in the case the retrieved on-chain parent_hash is We hope to have this upstream, and not to have to cherrypick it forever on our side. |
Please hard code those problematic blocks instead:
|
Should we use the newly added pub trait EthConfig<B: BlockT, C>: Send + Sync + 'static {
type EstimateGasAdapter: EstimateGasAdapter + Send + Sync;
type RuntimeStorageOverride: RuntimeStorageOverride<B, C>;
// new
type ForcedParentHashProvider: Get<HashMap<B::Hash, B::Hash>>
} |
@sorpaas ? |
This is up to you. Either a type parameter in One potential issue making this a type parameter is that it can't be customized "dynamically". This can happen, for example, when you need to start multiple chains based on the same type parameters. |
@sorpaas your suggestion made good sense since multiple chains based on same start code, are now able to pass in their own block hashes seamlessly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution LGTM.
Another question is that can we use the db cmd to fix the ethereum block hash storage associated with the broken block hash mapping? Seems another doable way.
The wrong hash is in the runtime storage, so it stays permanently in the blockchain. |
What
Populates the parent hash to enable indexers in the rpc response.
Note
We have been maintaining this functionality in our custom fork for a long time know, and would like to discuss around it if it makes sense for upstream as well.
/cc @tgmichel