Skip to content

Implement persistent reputation database for collator protocol (#7751)#10917

Merged
AlexandruCihodaru merged 190 commits intomasterfrom
acihodaru/persistent_db_mem
Feb 13, 2026
Merged

Implement persistent reputation database for collator protocol (#7751)#10917
AlexandruCihodaru merged 190 commits intomasterfrom
acihodaru/persistent_db_mem

Conversation

@AlexandruCihodaru
Copy link
Copy Markdown
Contributor

Implements persistent storage for the experimental collator protocol's reputation database.

Changes:

  • Adds PersistentDb wrapper that persists the in-memory reputation DB to disk
  • Periodic persistence every 10 minutes (30s in test mode)
  • Immediate persistence on slashes and parachain deregistration
  • Loads existing state on startup with lookback for missed blocks

Implementation:

PersistentDb wraps the existing Db and adds persistence on top:

- All reputation logic (scoring, decay, LRU) stays in `Db`
- Persistence layer handles disk I/O and serialization
- Per-para data stored in parachains_db

Tests:

  • basic_persistence.rs: Validates persistence across restarts and startup lookback
  • pruning.rs: Validates automatic cleanup on parachain deregistration

alindima added 30 commits April 3, 2025 11:18
…p-peer-manager' into alindima/collator-protocol-revamp-reputation-db-draft
…p-reputation-db-draft' into alindima/collator-protocol-revamp-collation-manager
@tdimitrov tdimitrov added the A4-backport-stable2603 Pull request must be backported to the stable2603 release branch label Feb 10, 2026
@AlexandruCihodaru
Copy link
Copy Markdown
Contributor Author

/cmd fmt

github-actions bot and others added 2 commits February 10, 2026 09:50
Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Copy link
Copy Markdown
Contributor

@sandreim sandreim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@AlexandruCihodaru
Copy link
Copy Markdown
Contributor Author

/cmd fmt

@tdimitrov
Copy link
Copy Markdown
Contributor

Looks good to me too! 👍

But why there are so many unrelated commits in the branch? For example:
Screenshot 2026-02-11 at 9 43 17
These are already in master.

@alindima
Copy link
Copy Markdown
Contributor

Looks good to me too! 👍

But why there are so many unrelated commits in the branch? For example: Screenshot 2026-02-11 at 9 43 17 These are already in master.

github is usually getting confused when changing the target branch, but the diff is clean and the merge commit should be clean as well

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Copy link
Copy Markdown
Contributor

@tdimitrov tdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @AlexandruCihodaru 🚀

Copy link
Copy Markdown
Contributor

@alindima alindima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AlexandruCihodaru AlexandruCihodaru added this pull request to the merge queue Feb 13, 2026
Merged via the queue into master with commit 744acf5 Feb 13, 2026
245 checks passed
@AlexandruCihodaru AlexandruCihodaru deleted the acihodaru/persistent_db_mem branch February 13, 2026 11:42
paritytech-release-backport-bot bot pushed a commit that referenced this pull request Feb 13, 2026
#10917)

Implements persistent storage for the experimental collator protocol's
reputation database.

Changes:

- Adds `PersistentDb` wrapper that persists the in-memory reputation DB
to disk
  - Periodic persistence every 10 minutes (30s in test mode)
  - Immediate persistence on slashes and parachain deregistration
  - Loads existing state on startup with lookback for missed blocks

Implementation:

  `PersistentDb` wraps the existing `Db` and adds persistence on top:

    - All reputation logic (scoring, decay, LRU) stays in `Db`
    - Persistence layer handles disk I/O and serialization
    - Per-para data stored in parachains_db

Tests:

- `basic_persistence.rs`: Validates persistence across restarts and
startup lookback
- `pruning.rs`: Validates automatic cleanup on parachain deregistration

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Co-authored-by: alindima <alin@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Serban Iorga <serban@parity.io>
Co-authored-by: Serban Iorga <serban300@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 744acf5)
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2603:

EgorPopelyaev added a commit that referenced this pull request Feb 16, 2026
Backport #10917 into `stable2603` from AlexandruCihodaru.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Signed-off-by: Alexandru Cihodaru <alexandru.cihodaru@parity.io>
Co-authored-by: Alexandru Cihodaru <40807189+AlexandruCihodaru@users.noreply.github.com>
Co-authored-by: alindima <alin@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Serban Iorga <serban@parity.io>
Co-authored-by: Serban Iorga <serban300@gmail.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Egor_P <egor@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2603 Pull request must be backported to the stable2603 release branch T8-polkadot This PR/Issue is related to/affects the Polkadot network.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants