Simplify replay vote tracking by using packet metadata (#21112)

This commit is contained in:
Justin Starry
2021-11-03 09:02:48 +00:00
committed by GitHub
parent e6280fc1fa
commit 140a5f633d
7 changed files with 43 additions and 47 deletions

View File

@ -1115,9 +1115,12 @@ impl BankingStage {
let tx: VersionedTransaction = limited_deserialize(&p.data[0..p.meta.size]).ok()?;
let message_bytes = Self::packet_message(p)?;
let message_hash = Message::hash_raw_message(message_bytes);
let tx = SanitizedTransaction::try_create(tx, message_hash, |_| {
Err(TransactionError::UnsupportedVersion)
})
let tx = SanitizedTransaction::try_create(
tx,
message_hash,
Some(p.meta.is_simple_vote_tx),
|_| Err(TransactionError::UnsupportedVersion),
)
.ok()?;
tx.verify_precompiles(feature_set).ok()?;
Some((tx, *tx_index))