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

ts-tests: listening for finalized blocks #1905

Open
2 tasks
grumpygreenguy opened this issue Jul 18, 2023 · 2 comments
Open
2 tasks

ts-tests: listening for finalized blocks #1905

grumpygreenguy opened this issue Jul 18, 2023 · 2 comments
Labels
D5-testing testing related tasks

Comments

@grumpygreenguy
Copy link
Contributor

Context

When a request entails a state change (e.g. link_identity, set_shielding_key), the client must make sure that the block containing the extrinsic is finalized in order to guarantee that the request was completed.

However, blocks are not finalized one by one but rather in chunks. This leads to, e.g. API methods like subscribeFinalizedHeads skipping blocks (i.e. only yielding the current block each time the chain is finalized, so the client would need to "catch up").

Our tests currently get away with checking all new blocks and assuming that the block of interest will not get discarded upon finalization; this is (possibly) good enough for a controlled environment, but not for a client in the wild (for whom the tests are supposed to serve as reference).

Polkadot.js has a solution via a plugin, but it may not be trivial to integrate into our parachain-api package.

Task

  • Evaluate if feasible to use @polkadot/api-derive in parachain-api
  • If not, implement an alternative solution to allow clients to scan all finalized blocks without manual catch-up
@grumpygreenguy grumpygreenguy added the D5-testing testing related tasks label Jul 18, 2023
@Kailai-Wang
Copy link
Collaborator

It looks like a medium prior issue, doesn't it?

@Kailai-Wang
Copy link
Collaborator

Still valid? @grumpygreenguy

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

No branches or pull requests

2 participants