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

sc-consensus-beefy: improve gossip logic #1852

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

acatangiu
Copy link
Contributor

  • Remove cached messages used for deduplication in GossipValidator since they're already deduplicated in upper layer NetworkGossip.
  • Add cache for "justified rounds" to quickly discard any further (even if potentially different) justifications at the gossip level, once a valid one (for a respective round) is submitted to the worker.
  • Add short-circuit in worker finalize() method to not attempt to finalize same block multiple times (for example when we get justifications for same block from multiple components like block-import, gossip or on-demand).
  • Change a test which had A LOT of latency in syncing blocks for some weird reason and would only run after ~150seconds. It now runs instantly.

Fixes #1728

Duplicated messages are already filtered one layer above in network-gossip
state_machine. No need for this extra complexity and locking here.

Instead add a "justified rounds" cache to quickly discard any further (even
if potentially different) justifications at the gossip level, once a valid
one is submitted to the worker.
@acatangiu acatangiu enabled auto-merge (squash) October 13, 2023 05:52
@acatangiu acatangiu merged commit 8320600 into paritytech:master Oct 13, 2023
108 of 109 checks passed
@acatangiu acatangiu deleted the improve-beefy-gossip branch October 13, 2023 08:38
ordian added a commit that referenced this pull request Oct 16, 2023
* master: (54 commits)
  Publish `xcm-emulator` crate (#1881)
  Adding migrations to clean Rococo Gov 1 storage & reserved funds (#1849)
  Arkworks Elliptic Curve utils overhaul (#1870)
  Fix typos (#1878)
  fix: GoAhead signal only set when runtime upgrade is enacted from parachain side (#1176)
  Refactor staking ledger (#1484)
  Paired-key Crypto Scheme (#1705)
  Include polkadot version in artifact path (#1828)
  add link to rfc-0001 in broker README (#1862)
  Discard `Executor` (#1855)
  Macros to use path instead of ident (#1474)
  Remove clippy clone-double-ref lint noise (#1860)
  Refactor alliance benchmarks to v2 (#1868)
  Check executor params coherence (#1774)
  frame: use derive-impl for beefy and mmr pallets (#1867)
  sc-consensus-beefy: improve gossip logic (#1852)
  Adds instance support for composite enums (#1857)
  Fix links to implementers' guide (#1865)
  Disabled validators runtime API (#1257)
  Adding `try_state` hook for `Treasury` pallet (#1820)
  ...
ordian added a commit that referenced this pull request Oct 16, 2023
…ribution

* tsv-disabling-backing: (54 commits)
  Publish `xcm-emulator` crate (#1881)
  Adding migrations to clean Rococo Gov 1 storage & reserved funds (#1849)
  Arkworks Elliptic Curve utils overhaul (#1870)
  Fix typos (#1878)
  fix: GoAhead signal only set when runtime upgrade is enacted from parachain side (#1176)
  Refactor staking ledger (#1484)
  Paired-key Crypto Scheme (#1705)
  Include polkadot version in artifact path (#1828)
  add link to rfc-0001 in broker README (#1862)
  Discard `Executor` (#1855)
  Macros to use path instead of ident (#1474)
  Remove clippy clone-double-ref lint noise (#1860)
  Refactor alliance benchmarks to v2 (#1868)
  Check executor params coherence (#1774)
  frame: use derive-impl for beefy and mmr pallets (#1867)
  sc-consensus-beefy: improve gossip logic (#1852)
  Adds instance support for composite enums (#1857)
  Fix links to implementers' guide (#1865)
  Disabled validators runtime API (#1257)
  Adding `try_state` hook for `Treasury` pallet (#1820)
  ...
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
- Remove cached messages used for deduplication in `GossipValidator`
since they're already deduplicated in upper layer `NetworkGossip`.
- Add cache for "justified rounds" to quickly discard any further (even
if potentially different) justifications at the gossip level, once a
valid one (for a respective round) is submitted to the worker.
- Add short-circuit in worker `finalize()` method to not attempt to
finalize same block multiple times (for example when we get
justifications for same block from multiple components like
block-import, gossip or on-demand).
- Change a test which had A LOT of latency in syncing blocks for some
weird reason and would only run after ~150seconds. It now runs
instantly.

Fixes paritytech#1728
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Mar 26, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Mar 27, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
…00_000 to 2_048 (paritytech#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
bkchr pushed a commit that referenced this pull request Apr 10, 2024
…00_000 to 2_048 (#1852)

* decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048

* spelling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rococo beefy error: BadJustification("Duplicate consensus engine ID") on appending justification
3 participants