-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement persistent reputation database for collator protocol (#7751) #10917
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
base: alindima/collator-protocol-revamp-collation-manager
Are you sure you want to change the base?
Changes from all commits
d52e2df
f8eaa63
2991942
d1ae2f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| // You should have received a copy of the GNU General Public License | ||
| // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| use codec::{Decode, Encode}; | ||
| use polkadot_node_network_protocol::{ | ||
| peer_set::CollationVersion, | ||
| request_response::{outgoing::RequestError, v2 as request_v2}, | ||
|
|
@@ -83,8 +84,17 @@ pub const MAX_FETCH_DELAY: Duration = Duration::from_millis(300); | |
| /// advertised collations. | ||
| pub const MIN_FETCH_TIMER_DELAY: Duration = Duration::from_millis(150); | ||
|
|
||
| /// How often to persist the reputation database to disk. | ||
| /// Using 10 minutes in production as a balance between data safety and disk I/O. | ||
| /// Using 30 seconds in test mode for faster test execution. | ||
| pub const REPUTATION_PERSIST_INTERVAL: Duration = if cfg!(feature = "test-persistence") { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the feature name is not expressive enough (what persistence is this referring to). |
||
| Duration::from_secs(30) | ||
| } else { | ||
| Duration::from_secs(10 * 60) | ||
| }; | ||
|
|
||
| /// Reputation score type. | ||
| #[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy, Default)] | ||
| #[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy, Default, Encode, Decode)] | ||
| pub struct Score(u16); | ||
|
|
||
| impl Score { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
persist interval is not here