Skip to content

Commit 980f257

Browse files
committed
update
1 parent 16e9349 commit 980f257

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

aptos-move/aptos-vm/src/aptos_vm.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,7 @@ impl AptosVM {
16781678
let args = serialize_values(
16791679
&block_metadata.get_prologue_move_args(account_config::reserved_vm_address()),
16801680
);
1681+
debug!(epoch = block_metadata.epoch, round = block_metadata.round, "Running BlockMetadata txn.");
16811682
session
16821683
.execute_function_bypass_visibility(
16831684
&BLOCK_MODULE,
@@ -1690,6 +1691,7 @@ impl AptosVM {
16901691
.or_else(|e| {
16911692
expect_only_successful_execution(e, BLOCK_PROLOGUE.as_str(), log_context)
16921693
})?;
1694+
debug!(epoch = block_metadata.epoch, round = block_metadata.round, "BlockMetadata txn finished.");
16931695
SYSTEM_TRANSACTIONS_EXECUTED.inc();
16941696

16951697
let output = get_transaction_output(
@@ -1698,6 +1700,7 @@ impl AptosVM {
16981700
ExecutionStatus::Success,
16991701
&get_or_vm_startup_failure(&self.storage_gas_params, log_context)?.change_set_configs,
17001702
)?;
1703+
debug!(epoch = block_metadata.epoch, round = block_metadata.round, "BlockMetadata txn result ok.");
17011704
Ok((VMStatus::Executed, output))
17021705
}
17031706

@@ -1753,6 +1756,7 @@ impl AptosVM {
17531756
.as_move_value(),
17541757
];
17551758

1759+
debug!(epoch = epoch, round = round, "Running BlockMetadataExt txn.");
17561760
session
17571761
.execute_function_bypass_visibility(
17581762
&BLOCK_MODULE,
@@ -1765,6 +1769,7 @@ impl AptosVM {
17651769
.or_else(|e| {
17661770
expect_only_successful_execution(e, BLOCK_PROLOGUE_EXT.as_str(), log_context)
17671771
})?;
1772+
debug!(epoch = epoch, round = round, "BlockMetadataExt txn finished.");
17681773
SYSTEM_TRANSACTIONS_EXECUTED.inc();
17691774

17701775
let output = get_transaction_output(
@@ -1773,7 +1778,7 @@ impl AptosVM {
17731778
ExecutionStatus::Success,
17741779
&get_or_vm_startup_failure(&self.storage_gas_params, log_context)?.change_set_configs,
17751780
)?;
1776-
1781+
debug!(epoch = epoch, round = round, "BlockMetadataExt txn result ok.");
17771782
Ok((VMStatus::Executed, output))
17781783
}
17791784

aptos-move/framework/aptos-framework/sources/block.move

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module aptos_framework::block {
55
use std::vector;
66
use std::option;
77
use std::option::Option;
8+
use std::string::utf8;
9+
use aptos_std::debug;
810
use aptos_framework::randomness;
911

1012
use aptos_framework::account;
@@ -172,6 +174,7 @@ module aptos_framework::block {
172174
let epoch_interval = block_prologue_common(&vm, hash, epoch, round, proposer, failed_proposer_indices, previous_block_votes_bitvec, timestamp);
173175
randomness::on_new_block(&vm, epoch, round, option::none());
174176
if (timestamp - reconfiguration::last_reconfiguration_time() >= epoch_interval) {
177+
debug::print(&utf8(b"epoch time out"));
175178
reconfiguration::reconfigure();
176179
};
177180
}

aptos-move/framework/src/natives/debug.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,10 @@ fn native_print(
3232
debug_assert!(ty_args.is_empty());
3333
debug_assert!(args.len() == 1);
3434

35-
if cfg!(feature = "testing") {
36-
let val = safely_pop_arg!(args, Struct);
37-
let bytes = val.unpack()?.next().unwrap();
38-
39-
println!(
40-
"[debug] {}",
41-
std::str::from_utf8(&bytes.value_as::<Vec<u8>>()?).unwrap()
42-
);
43-
}
35+
println!(
36+
"[debug] {}",
37+
std::str::from_utf8(&bytes.value_as::<Vec<u8>>()?).unwrap()
38+
);
4439

4540
Ok(smallvec![])
4641
}

0 commit comments

Comments
 (0)