Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into aschran/cc-estimator-2
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran committed Jan 30, 2025
2 parents 1c5e1fd + b0e76cc commit 16ae058
Show file tree
Hide file tree
Showing 148 changed files with 6,322 additions and 2,972 deletions.
22 changes: 13 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
processed 3 tasks

init:
A: object(0,0)

task 1, lines 8-14:
//# publish
created: object(1,0)
mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 0, non_refundable_storage_fee: 0

task 2, lines 16-17:
//# programmable --sender A --inputs 0 --dev-inspect
//> 0: test::m::return_ref(Input(0));
mutated: object(_)
gas summary: computation_cost: 500000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

// attempt to return a reference from a function

//# init --addresses test=0x0 --accounts A

//# publish

module test::m {
public fun return_ref(n: &u64): &u64 {
n
}
}

//# programmable --sender A --inputs 0 --dev-inspect
//> 0: test::m::return_ref(Input(0));
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
processed 3 tasks

init:
A: object(0,0)

task 1, lines 8-14:
//# publish
created: object(1,0)
mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 3465600, storage_rebate: 0, non_refundable_storage_fee: 0

task 2, lines 16-17:
//# programmable --sender A --inputs 0 --dry-run
//> 0: test::m::return_ref(Input(0));
Error: Transaction Effects Status: InvalidPublicFunctionReturnType { idx: 0 } in command 0
Execution Error: InvalidPublicFunctionReturnType { idx: 0 } in command 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

// attempt to return a reference from a function

//# init --addresses test=0x0 --accounts A

//# publish

module test::m {
public fun return_ref(n: &u64): &u64 {
n
}
}

//# programmable --sender A --inputs 0 --dry-run
//> 0: test::m::return_ref(Input(0));
4 changes: 3 additions & 1 deletion crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,9 @@ impl AuthorityState {
)
.await
.tap_err(|e| info!("process_certificate failed: {e}"))
.tap_ok(|_| debug!("process_certificate succeeded"))?;
.tap_ok(
|(fx, _)| debug!(?tx_digest, fx_digest=?fx.digest(), "process_certificate succeeded"),
)?;

epoch_store.record_local_execution_time(
certificate.data().transaction_data(),
Expand Down
19 changes: 9 additions & 10 deletions crates/sui-core/src/checkpoints/checkpoint_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl CheckpointExecutor {

/// Post processing and plumbing after we executed a checkpoint. This function is guaranteed
/// to be called in the order of checkpoint sequence number.
#[instrument(level = "debug", skip_all)]
#[instrument(level = "info", skip_all, fields(seq = ?checkpoint.sequence_number()))]
async fn process_executed_checkpoint(
&self,
epoch_store: &AuthorityPerEpochStore,
Expand All @@ -447,7 +447,7 @@ impl CheckpointExecutor {
) {
// Commit all transaction effects to disk
let cache_commit = self.state.get_cache_commit();
debug!(seq = ?checkpoint.sequence_number, "committing checkpoint transactions to disk");
debug!("committing checkpoint transactions to disk");
cache_commit
.commit_transaction_outputs(
epoch_store.epoch(),
Expand Down Expand Up @@ -1040,8 +1040,8 @@ fn extract_end_of_epoch_tx(
let change_epoch_tx = VerifiedExecutableTransaction::new_from_checkpoint(
(*change_epoch_tx.unwrap_or_else(||
panic!(
"state-sync should have ensured that transaction with digest {:?} exists for checkpoint: {checkpoint:?}",
digests.transaction,
"state-sync should have ensured that transaction with digests {:?} exists for checkpoint: {checkpoint:?}",
digests
)
)).clone(),
epoch_store.epoch(),
Expand Down Expand Up @@ -1100,16 +1100,15 @@ fn get_unexecuted_transactions(

// Remove the change epoch transaction so that we can special case its execution.
checkpoint.end_of_epoch_data.as_ref().tap_some(|_| {
let change_epoch_tx_digest = execution_digests
let digests = execution_digests
.pop()
.expect("Final checkpoint must have at least one transaction")
.transaction;
.expect("Final checkpoint must have at least one transaction");

let change_epoch_tx = cache_reader
.get_transaction_block(&change_epoch_tx_digest)
.get_transaction_block(&digests.transaction)
.unwrap_or_else(||
panic!(
"state-sync should have ensured that transaction with digest {change_epoch_tx_digest:?} exists for checkpoint: {}",
"state-sync should have ensured that transaction with digests {digests:?} exists for checkpoint: {}",
checkpoint.sequence_number()
)
);
Expand Down Expand Up @@ -1138,7 +1137,7 @@ fn get_unexecuted_transactions(
let maybe_randomness_tx = cache_reader.get_transaction_block(&first_digest.transaction)
.unwrap_or_else(||
panic!(
"state-sync should have ensured that transaction with digest {first_digest:?} exists for checkpoint: {}",
"state-sync should have ensured that transaction with digests {first_digest:?} exists for checkpoint: {}",
checkpoint.sequence_number()
)
);
Expand Down
Loading

0 comments on commit 16ae058

Please sign in to comment.