Use rooted bank by default in rpc bank selection (#6759)

* Name anonymous parameters for clarity

* Add CommitmentConfig to select bank for rpc

* Add commitment information to jsonrpc docs

* Update send_and_confirm retries as per commitment defaults

* Pass CommitmentConfig into client requests; also various 'use' cleanup

* Use _with_commitment methods to speed local_cluster tests

* Pass CommitmentConfig into Archiver in order to enable quick confirmations in local_cluster tests

* Restore solana ping speed

* Increase wallet-sanity timeout to account for longer confirmation time
This commit is contained in:
Tyera Eulberg
2019-11-06 14:15:00 -07:00
committed by GitHub
parent 5e8668799c
commit b3a75a60a4
27 changed files with 1225 additions and 463 deletions

View File

@ -0,0 +1,36 @@
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct CommitmentConfig {
pub commitment: CommitmentLevel,
}
impl Default for CommitmentConfig {
fn default() -> Self {
CommitmentConfig {
commitment: CommitmentLevel::Max,
}
}
}
impl CommitmentConfig {
pub fn recent() -> Self {
Self {
commitment: CommitmentLevel::Recent,
}
}
pub fn ok(&self) -> Option<Self> {
if self == &Self::default() {
None
} else {
Some(self.clone())
}
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub enum CommitmentLevel {
Max,
Recent,
}