Skip to content

Commit

Permalink
Enable the simulation without the authentication key check
Browse files Browse the repository at this point in the history
  • Loading branch information
junkil-park committed Jun 14, 2024
1 parent 2823f2e commit 4e10c7d
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 93 deletions.
2 changes: 2 additions & 0 deletions aptos-move/aptos-vm/src/aptos_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,7 @@ impl AptosVM {
txn_data,
log_context,
traversal_context,
self.is_simulation,
)
},
TransactionPayload::Multisig(multisig_payload) => {
Expand All @@ -2351,6 +2352,7 @@ impl AptosVM {
txn_data,
log_context,
traversal_context,
self.is_simulation,
)?;
// Skip validation if this is part of tx simulation.
// This allows simulating multisig txs without having to first create the multisig
Expand Down
4 changes: 4 additions & 0 deletions aptos-move/aptos-vm/src/transaction_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub(crate) fn run_script_prologue(
txn_data: &TransactionMetadata,
log_context: &AdapterLogSchema,
traversal_context: &mut TraversalContext,
is_simulation: bool,
) -> Result<(), VMStatus> {
let txn_sequence_number = txn_data.sequence_number();
let txn_authentication_key = txn_data.authentication_key().to_vec();
Expand Down Expand Up @@ -118,6 +119,7 @@ pub(crate) fn run_script_prologue(
MoveValue::U64(txn_max_gas_units.into()),
MoveValue::U64(txn_expiration_timestamp_secs),
MoveValue::U8(chain_id.id()),
MoveValue::Bool(is_simulation),
];
if txn_data.required_deposit.is_some() {
args.push(txn_data.required_deposit.as_move_value());
Expand All @@ -139,6 +141,7 @@ pub(crate) fn run_script_prologue(
MoveValue::U64(txn_max_gas_units.into()),
MoveValue::U64(txn_expiration_timestamp_secs),
MoveValue::U8(chain_id.id()),
MoveValue::Bool(is_simulation),
];
(
&APTOS_TRANSACTION_VALIDATION.multi_agent_prologue_name,
Expand All @@ -154,6 +157,7 @@ pub(crate) fn run_script_prologue(
MoveValue::U64(txn_expiration_timestamp_secs),
MoveValue::U8(chain_id.id()),
MoveValue::vector_u8(txn_data.script_hash.clone()),
MoveValue::Bool(is_simulation),
];
if txn_data.required_deposit.is_some() {
args.push(txn_data.required_deposit.as_move_value());
Expand Down
Loading

0 comments on commit 4e10c7d

Please sign in to comment.