Deprecate commitment variants (#14797)

* Deprecate commitment variants

* Add new CommitmentConfig builders

* Add helpers to avoid allowing deprecated variants

* Remove deprecated transaction-status code

* Include new commitment variants in runtime commitment; allow deprecated as long as old variants persist

* Remove deprecated banks code

* Remove deprecated variants in core; allow deprecated in rpc/rpc-subscriptions for now

* Heavier hand with rpc/rpc-subscription commitment

* Remove deprecated variants from local-cluster

* Remove deprecated variants from various tools

* Remove deprecated variants from validator

* Update docs

* Remove deprecated client code

* Add new variants to cli; remove deprecated variants as possible

* Don't send new commitment variants to old clusters

* Retain deprecated method in test_validator_saves_tower

* Fix clippy matches! suggestion for BPF solana-sdk legacy compile test

* Refactor node version check to handle commitment variants and transaction encoding

* Hide deprecated variants from cli help

* Add cli App comments
This commit is contained in:
Tyera Eulberg
2021-01-26 12:23:07 -07:00
committed by GitHub
parent e08d2e6fcc
commit ffa5c7dcc8
37 changed files with 540 additions and 322 deletions

View File

@@ -435,7 +435,7 @@ impl LocalCluster {
) -> u64 {
trace!("getting leader blockhash");
let (blockhash, _fee_calculator, _last_valid_slot) = client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.unwrap();
let mut tx =
system_transaction::transfer(&source_keypair, dest_pubkey, lamports, blockhash);
@@ -452,7 +452,7 @@ impl LocalCluster {
.wait_for_balance_with_commitment(
dest_pubkey,
Some(lamports),
CommitmentConfig::recent(),
CommitmentConfig::processed(),
)
.expect("get balance")
}
@@ -474,7 +474,7 @@ impl LocalCluster {
// Create the vote account if necessary
if client
.poll_get_balance_with_commitment(&vote_account_pubkey, CommitmentConfig::recent())
.poll_get_balance_with_commitment(&vote_account_pubkey, CommitmentConfig::processed())
.unwrap_or(0)
== 0
{
@@ -496,7 +496,7 @@ impl LocalCluster {
&[from_account.as_ref(), vote_account],
message,
client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.unwrap()
.0,
);
@@ -507,7 +507,7 @@ impl LocalCluster {
.wait_for_balance_with_commitment(
&vote_account_pubkey,
Some(amount),
CommitmentConfig::recent(),
CommitmentConfig::processed(),
)
.expect("get balance");
@@ -524,7 +524,7 @@ impl LocalCluster {
&[from_account.as_ref(), &stake_account_keypair],
message,
client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.unwrap()
.0,
);
@@ -541,7 +541,7 @@ impl LocalCluster {
.wait_for_balance_with_commitment(
&stake_account_pubkey,
Some(amount),
CommitmentConfig::recent(),
CommitmentConfig::processed(),
)
.expect("get balance");
} else {
@@ -552,8 +552,9 @@ impl LocalCluster {
}
info!("Checking for vote account registration of {}", node_pubkey);
match (
client.get_account_with_commitment(&stake_account_pubkey, CommitmentConfig::recent()),
client.get_account_with_commitment(&vote_account_pubkey, CommitmentConfig::recent()),
client
.get_account_with_commitment(&stake_account_pubkey, CommitmentConfig::processed()),
client.get_account_with_commitment(&vote_account_pubkey, CommitmentConfig::processed()),
) {
(Ok(Some(stake_account)), Ok(Some(vote_account))) => {
match (