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

Improve relay chain header selection algorithm #2825

Closed
svyatonik opened this issue Feb 6, 2024 · 1 comment
Closed

Improve relay chain header selection algorithm #2825

svyatonik opened this issue Feb 6, 2024 · 1 comment
Labels
A-feat New feature or request

Comments

@svyatonik
Copy link
Contributor

Right now batch relayer uses following strategy for selecting relay chain header H or its descendant: it simultaneously (1) starts reading finality notifications from the stream and once proof for the H or its descendant found, yields (2) starts searching for the persistent justifications, starting from H and once persistent justification is found for H or its descendant, yields.

This is to decrease bridge latency. However it brings some inconveniences - e.g. it is hard to read set_id from the source chain (see #2821) because for block, justified with persistent justification the state may be discarded, so we need to use some tricks to guess the set_id (e.g. read at latest block + start incrementing best set_id until justification is verified). It'd be good to have a way to know the id of set that has generated justification to check it explicitly in the relayer code. Now we rely on the verify_and_optimize_proof to verify justification using set_id, read from the target chain. It may cause some side issues (e.g. #2394).

Maybe we should prefer justifications from the subscription stream, but if we fail to get justification for some time (e.g. 12+ seconds), start searching for persistent justifications too. Need to think what is better here

@svyatonik svyatonik added the A-feat New feature or request label Feb 6, 2024
@svyatonik svyatonik added this to the To explore in the future milestone Feb 6, 2024
@svyatonik
Copy link
Contributor Author

Not actual with #3002

@svyatonik svyatonik closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-feat New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant