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

@ -1046,7 +1046,7 @@ mod tests {
let test_validator = TestValidator::with_no_fees(alice.pubkey());
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
test_process_distribute_tokens_with_client(&client, alice, None);
}
@ -1056,7 +1056,7 @@ mod tests {
let test_validator = TestValidator::with_no_fees(alice.pubkey());
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
test_process_distribute_tokens_with_client(&client, alice, Some(sol_to_lamports(1.5)));
}
@ -1066,7 +1066,7 @@ mod tests {
let test_validator = TestValidator::with_no_fees(alice.pubkey());
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
test_process_distribute_stake_with_client(&client, alice);
}
@ -1381,7 +1381,7 @@ mod tests {
let test_validator = TestValidator::with_custom_fees(alice.pubkey(), fees);
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
let sender_keypair_file = tmp_file_path("keypair_file", &alice.pubkey());
write_keypair_file(&alice, &sender_keypair_file).unwrap();
@ -1464,7 +1464,7 @@ mod tests {
let test_validator = TestValidator::with_custom_fees(alice.pubkey(), fees);
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
let sender_keypair_file = tmp_file_path("keypair_file", &alice.pubkey());
write_keypair_file(&alice, &sender_keypair_file).unwrap();
@ -1573,7 +1573,7 @@ mod tests {
let alice = Keypair::new();
let test_validator = TestValidator::with_custom_fees(alice.pubkey(), fees);
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
let sender_keypair_file = tmp_file_path("keypair_file", &alice.pubkey());
write_keypair_file(&alice, &sender_keypair_file).unwrap();
@ -1680,7 +1680,7 @@ mod tests {
let test_validator = TestValidator::with_custom_fees(alice.pubkey(), fees);
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
let sender_keypair_file = tmp_file_path("keypair_file", &alice.pubkey());
write_keypair_file(&alice, &sender_keypair_file).unwrap();
@ -1994,7 +1994,7 @@ mod tests {
let sender_keypair = Keypair::new();
let test_validator = TestValidator::with_no_fees(sender_keypair.pubkey());
let url = test_validator.rpc_url();
let client = RpcClient::new_with_commitment(url, CommitmentConfig::recent());
let client = RpcClient::new_with_commitment(url, CommitmentConfig::processed());
let fee_payer = Keypair::new();
let transaction = transfer(