litentry / litentry-parachain

The Litentry parachain
https://docs.litentry.com
GNU General Public License v3.0
61 stars 20 forks source link

ts-tests: listening for finalized blocks #1905

Open grumpygreenguy opened 1 year ago

grumpygreenguy commented 1 year ago

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

Kailai-Wang commented 1 year ago

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

Kailai-Wang commented 3 months ago

Still valid? @grumpygreenguy