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 the way relayer get state updates #2428

Open
svyatonik opened this issue Apr 25, 2023 · 1 comment
Open

Improve the way relayer get state updates #2428

svyatonik opened this issue Apr 25, 2023 · 1 comment
Assignees

Comments

@svyatonik
Copy link
Contributor

Right now messages relay that works with parachains polls target node every 12s (parachain block time) to read state updates. If it awakes at T and actual parachain block time is e.g. T + 1s, it means that the relayer will get the updated state in another 11s. During that period, it may decide to submit some transaction that contain obsolete nonces. And this transaction may be invalidated when e.g. next block is built. So it'll be ~40s for the whole scheme. We may decrease it down to 12-24s just just by switching to

Possible solutions:

  • use new heads subscription instead of manual polling. This is a good solution, but let's have subscription sharing + caching (Cache results of RPC requests #1820) first;
  • dumb, but easy-to-implement solution. We may just decrease the polling interval. We also may try to guess next block time. I.e. sleep 1s first, then when we see block, schedule next awake in 11s. If we don't see block, awake in 1s and so on.
@svyatonik svyatonik self-assigned this May 3, 2023
svyatonik referenced this issue Jul 17, 2023
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](assert-rs/assert_cmd@v2.0.7...v2.0.8)

---
updated-dependencies:
- dependency-name: assert_cmd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@EmmanuellNorbertTulbure EmmanuellNorbertTulbure transferred this issue from paritytech/parity-bridges-common Aug 25, 2023
@the-right-joyce the-right-joyce transferred this issue from paritytech/polkadot-sdk Aug 25, 2023
@EmmanuellNorbertTulbure
Copy link

@svyatonik to recheck and merge the PR

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