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

Monitor bridge GRANDPA transactions #2447

Open
2 of 3 tasks
svyatonik opened this issue Feb 21, 2023 · 2 comments
Open
2 of 3 tasks

Monitor bridge GRANDPA transactions #2447

svyatonik opened this issue Feb 21, 2023 · 2 comments

Comments

@svyatonik
Copy link
Contributor

svyatonik commented Feb 21, 2023

Related to #2496

#1882 introduces some constants, related to weight and size (soft) limits of pallet-bridge-grandpa transactions. We shall add monitoring stuff (loki + relay logs + alerts OR relay metrics + dashboards + alerts?) to our substrate-relay (or some separate process). The relay must look at all pallet transactions and:

  • search transactions with invalid headers in votes_ancestries. If there are such headers, it means that the GRANDPA authority is cheating;
  • search transactions with unknown headers in votes_ancestries. Unknown means that we can't find header on other nodes. Such transaction means that the BABE+GRANDPA authority/authorities are possibly cheating;
  • search transactions that are above our limits. We may need to increase limits if we see such transactions
svyatonik referenced this issue Jul 17, 2023
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.25 to 4.0.26.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@v4.0.25...v4.0.26)

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

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
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

@svyatonik
Copy link
Contributor Author

search transactions that are above our limits. We may need to increase limits if we see such transactions

There are two limits:

  • REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY set to 2. Normally it is zero. If it is larger (given optimal justification), it means that GRANDPA is lagging;
  • AVERAGE_HEADER_SIZE_IN_JUSTIFICATION is set to 20kb. Regular Kusama header is ~300b, but on epoch change it is 40Kb;
  • MAX_HEADER_SIZE is set to 90_000b.

So we expect to see:

  • 2 or less headers in votes ancestry;
  • header+justification, which is near to 90_000 + 2*20kb ~ 130_000 bytes.

If we see transaction over those limits, then:

  • if that's a standalone submit_finality_proof for mandatory header, the relayer pays regular fee. Normally mandatory headers submission is free;
  • if such header+justification is submitted in batch with delivery/confirmation transaction, we partially refund the tx cost. I.e. if there are more than REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY headers in ancestry, we only refund for REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY headers and so on.

So we need a metrics for actual values in source chain headers and if they are above the limits, we'll need to change constants OR ELSE relayers will keep (partially) spending funds. I'd add this either in v1, or soon after the launch. OTOH, we have enough reserve in those constants, so we unlikely to overflow. So maybe "soon after the launch" is a way to go here. @EmmanuellNorbertTulbure Please triage :)

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