Skip to content
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

How do we get block finalization for blockchains with a permanent gap? #5323

Closed
shamil-gadelshin opened this issue Aug 12, 2024 · 3 comments
Closed

Comments

@shamil-gadelshin
Copy link
Contributor

We use Substrate framework for our blockchain and encounter a problem with block finalization. It seems Substrate doesn't support a use case with a permanent block gap created by some form of fast sync.

Take Client.apply_finality_with_block_hash from sc-service crate for example: it uses tree_route method several times which will fail when we try to finalize a recent block received by sync (it will try to obtain a path to the last finalized block which will be the genesis and fail on missing blocks between genesis and some recent block having a permanent gap created by some form of fast sync).
Substrate solves it by downloading the gap and finalizing blocks after that (all the block headers will be present in the db). But what if in our case we don't need to download even headers?

How do we get block finalization having a permanent block gap?

Here is the related issue: #5119 (edited)

@paritytech paritytech deleted a comment Aug 12, 2024
@bkchr
Copy link
Member

bkchr commented Aug 12, 2024

Sounds like this is a duplicate of your own issue: #4407?

@shamil-gadelshin
Copy link
Contributor Author

Sounds like this is a duplicate of your own issue: #4407?

It's more like a subtask than a duplicate. We discovered it recently and the finalization problem was not mentioned in #4407

@shamil-gadelshin
Copy link
Contributor Author

Substrate already has a way to deal with such cases. BlockImportParams.finalized resolves the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants