-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented paravalidation notifications. Dependency updates.
- Loading branch information
Showing
31 changed files
with
345 additions
and
156 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<strong>{{ validator_display }}</strong> | ||
⭐ is now a paravalidator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ validator_display }} | ||
⭐ is now a paravalidator. |
1 change: 1 addition & 0 deletions
1
_template/email/chain_validator_started_para_validating_subject.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ validator_display }} paravalidation status update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<strong>{{ validator_display }}</strong> | ||
⭕ is not anymore a paravalidator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ validator_display }} | ||
⭕ is not anymore a paravalidator. |
1 change: 1 addition & 0 deletions
1
_template/email/chain_validator_stopped_para_validating_subject.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ validator_display }} paravalidation status update |
2 changes: 2 additions & 0 deletions
2
_template/push_notification/chain_validator_started_para_validating.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ validator_display }} | ||
⭐ is now a paravalidator. |
2 changes: 2 additions & 0 deletions
2
_template/push_notification/chain_validator_stopped_para_validating.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ validator_display }} | ||
⭕ is not anymore a paravalidator. |
2 changes: 2 additions & 0 deletions
2
_template/telegram/chain_validator_started_para_validating.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<strong>{{ validator_display }}</strong> | ||
⭐ is now a paravalidator. |
2 changes: 2 additions & 0 deletions
2
_template/telegram/chain_validator_stopped_para_validating.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<strong>{{ validator_display }}</strong> | ||
⭕ is not anymore a paravalidator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paravalidation » |
1 change: 1 addition & 0 deletions
1
_template/telegram/dialog/settings_item_started_para_validating.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% if is_on %}🟢{% else %}⚪️{% endif %} Started Paravalidating |
1 change: 1 addition & 0 deletions
1
_template/telegram/dialog/settings_item_stopped_para_validating.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% if is_on %}🟢{% else %}⚪️{% endif %} Stopped Paravalidating |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- PARAVALIDATION - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
subvt-notification-generator/src/inspect/validator_list/update/para_validation.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
use crate::{NotificationGenerator, CONFIG}; | ||
use std::sync::Arc; | ||
use subvt_persistence::postgres::app::PostgreSQLAppStorage; | ||
use subvt_types::app::NotificationTypeCode; | ||
use subvt_types::subvt::ValidatorDetails; | ||
|
||
impl NotificationGenerator { | ||
pub(crate) async fn inspect_para_validating( | ||
&self, | ||
app_postgres: Arc<PostgreSQLAppStorage>, | ||
finalized_block_number: u64, | ||
last: &ValidatorDetails, | ||
current: &ValidatorDetails, | ||
) -> anyhow::Result<()> { | ||
if current.is_para_validator && !last.is_para_validator { | ||
log::debug!("Started paravalidating: {}", current.account.address); | ||
let rules = app_postgres | ||
.get_notification_rules_for_validator( | ||
&NotificationTypeCode::ChainValidatorStartedParaValidating.to_string(), | ||
CONFIG.substrate.network_id, | ||
¤t.account.id, | ||
) | ||
.await?; | ||
self.generate_notifications( | ||
app_postgres, | ||
&rules, | ||
finalized_block_number, | ||
&Some(current.account.id), | ||
None::<&()>, | ||
) | ||
.await?; | ||
} else if !current.is_para_validator && last.is_para_validator { | ||
log::debug!("Stopped paravalidating: {}", current.account.address); | ||
let rules = app_postgres | ||
.get_notification_rules_for_validator( | ||
&NotificationTypeCode::ChainValidatorStoppedParaValidating.to_string(), | ||
CONFIG.substrate.network_id, | ||
¤t.account.id, | ||
) | ||
.await?; | ||
self.generate_notifications( | ||
app_postgres, | ||
&rules, | ||
finalized_block_number, | ||
&Some(current.account.id), | ||
None::<&()>, | ||
) | ||
.await?; | ||
} | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.