SecretStore: tx retry pattern (#7323)
* SecretStore: auto migrate initial commit * SecretStore: flush automigrate * SecretStore: debug flush * SecretStore: added migration to KeyServerSet contract * SecretStore: flush automigrate * SecretStore: flush before testing * SecretStore: flush * SecretStore: flush * SecretStore: bunch of tests for simple ConnectionTrigger && KeyServerSet * SecretStore: started work on TriggerWithMigration tests * SecretStore: maintain_session tests * SecretStore: updated some comments * SecretStore pass migration_id to ServerSetChangeSession * SecretStore: fixed lock scope * SecretStore: fixed error response condition * SecretStore: fixed ServerSetChange session auto-creation * SecretStore: update active migration in connector * removed commented code * SecretStore: fixed tests compilation * SecretStore: marked test-related unimplemented-s * SecretStore: labeled all SS TODOs * SecretStore: do not read auto-migration stuff when auto-migration is disabled + stripped KeyServerSet contract ABI * SecretStore: ignore duplicated addresses in KeyServerSet * fied compilation * SecretStore: wait for N block confirmations before starting auto-migration * SecretStore: more tests for migration delay * SecretStore: clear current nodes set when KSS contract is uninstalled * SecretStore: retry transaction interval
This commit is contained in:
committed by
Afri Schoedon
parent
7e0928b8a2
commit
b685b7fae3
@@ -556,6 +556,10 @@ usage! {
|
||||
"--no-acl-check",
|
||||
"Disable ACL check (useful for test environments).",
|
||||
|
||||
FLAG flag_no_secretstore_auto_migrate: (bool) = false, or |c: &Config| otry!(c.secretstore).disable_auto_migrate.clone(),
|
||||
"--no-secretstore-auto-migrate",
|
||||
"Do not run servers set change session automatically when servers set changes. This option has no effect when servers set is read from configuration file.",
|
||||
|
||||
ARG arg_secretstore_contract: (String) = "none", or |c: &Config| otry!(c.secretstore).service_contract.clone(),
|
||||
"--secretstore-contract=[SOURCE]",
|
||||
"Secret Store Service contract address source: none, registry (contract address is read from registry) or address.",
|
||||
@@ -589,7 +593,7 @@ usage! {
|
||||
"Hex-encoded secret key of this node.",
|
||||
|
||||
ARG arg_secretstore_admin_public: (Option<String>) = None, or |c: &Config| otry!(c.secretstore).admin_public.clone(),
|
||||
"--secretstore-admin-public=[PUBLIC]",
|
||||
"--secretstore-admin=[PUBLIC]",
|
||||
"Hex-encoded public key of secret store administrator.",
|
||||
|
||||
["Sealing/Mining options"]
|
||||
@@ -1111,6 +1115,7 @@ struct SecretStore {
|
||||
disable: Option<bool>,
|
||||
disable_http: Option<bool>,
|
||||
disable_acl_check: Option<bool>,
|
||||
disable_auto_migrate: Option<bool>,
|
||||
service_contract: Option<String>,
|
||||
self_secret: Option<String>,
|
||||
admin_public: Option<String>,
|
||||
@@ -1519,9 +1524,11 @@ mod tests {
|
||||
arg_dapps_path: "$HOME/.parity/dapps".into(),
|
||||
flag_no_dapps: false,
|
||||
|
||||
// SECRETSTORE
|
||||
flag_no_secretstore: false,
|
||||
flag_no_secretstore_http: false,
|
||||
flag_no_secretstore_acl_check: false,
|
||||
flag_no_secretstore_auto_migrate: false,
|
||||
arg_secretstore_contract: "none".into(),
|
||||
arg_secretstore_secret: None,
|
||||
arg_secretstore_admin_public: None,
|
||||
@@ -1773,6 +1780,7 @@ mod tests {
|
||||
disable: None,
|
||||
disable_http: None,
|
||||
disable_acl_check: None,
|
||||
disable_auto_migrate: None,
|
||||
service_contract: None,
|
||||
self_secret: None,
|
||||
admin_public: None,
|
||||
|
||||
@@ -610,6 +610,7 @@ impl Configuration {
|
||||
enabled: self.secretstore_enabled(),
|
||||
http_enabled: self.secretstore_http_enabled(),
|
||||
acl_check_enabled: self.secretstore_acl_check_enabled(),
|
||||
auto_migrate_enabled: self.secretstore_auto_migrate_enabled(),
|
||||
service_contract_address: self.secretstore_service_contract_address()?,
|
||||
self_secret: self.secretstore_self_secret()?,
|
||||
nodes: self.secretstore_nodes()?,
|
||||
@@ -1088,6 +1089,10 @@ impl Configuration {
|
||||
!self.args.flag_no_secretstore_acl_check
|
||||
}
|
||||
|
||||
fn secretstore_auto_migrate_enabled(&self) -> bool {
|
||||
!self.args.flag_no_secretstore_auto_migrate
|
||||
}
|
||||
|
||||
fn secretstore_service_contract_address(&self) -> Result<Option<SecretStoreContractAddress>, String> {
|
||||
Ok(match self.args.arg_secretstore_contract.as_ref() {
|
||||
"none" => None,
|
||||
|
||||
@@ -51,6 +51,8 @@ pub struct Configuration {
|
||||
pub http_enabled: bool,
|
||||
/// Is ACL check enabled.
|
||||
pub acl_check_enabled: bool,
|
||||
/// Is auto migrate enabled.
|
||||
pub auto_migrate_enabled: bool,
|
||||
/// Service contract address.
|
||||
pub service_contract_address: Option<ContractAddress>,
|
||||
/// This node secret.
|
||||
@@ -166,6 +168,7 @@ mod server {
|
||||
})).collect(),
|
||||
allow_connecting_to_higher_nodes: true,
|
||||
admin_public: conf.admin_public,
|
||||
auto_migrate_enabled: conf.auto_migrate_enabled,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -190,6 +193,7 @@ impl Default for Configuration {
|
||||
enabled: true,
|
||||
http_enabled: true,
|
||||
acl_check_enabled: true,
|
||||
auto_migrate_enabled: true,
|
||||
service_contract_address: None,
|
||||
self_secret: None,
|
||||
admin_public: None,
|
||||
|
||||
Reference in New Issue
Block a user