Add simulation detection countermeasure (#22880)

* Add simulation detection countermeasures

* Add program and test using TestValidator

* Remove incinerator deposit

* Remove incinerator

* Update Cargo.lock

* Add more features to simulation bank

* Update Cargo.lock per rebase

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
This commit is contained in:
Michael Vines
2022-02-15 04:09:59 -08:00
committed by GitHub
parent d2a407a9a7
commit c42b80f099
11 changed files with 2824 additions and 166 deletions

View File

@ -3472,7 +3472,7 @@ pub mod rpc_full {
let preflight_commitment = config
.preflight_commitment
.map(|commitment| CommitmentConfig { commitment });
let preflight_bank = &*meta.bank(preflight_commitment);
let preflight_bank = meta.bank(preflight_commitment);
let transaction = sanitize_transaction(unsanitized_tx)?;
let signature = *transaction.signature();
@ -3569,7 +3569,7 @@ pub mod rpc_full {
let (_, mut unsanitized_tx) =
decode_and_deserialize::<VersionedTransaction>(data, encoding)?;
let bank = &*meta.bank(config.commitment);
let bank = meta.bank(config.commitment);
if config.replace_recent_blockhash {
if config.sig_verify {
return Err(Error::invalid_params(
@ -3637,7 +3637,7 @@ pub mod rpc_full {
};
Ok(new_response(
bank,
&bank,
RpcSimulateTransactionResult {
err: result.err(),
logs: Some(logs),