Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tracing in the execution layer #21165

Merged
merged 14 commits into from
Feb 13, 2025
7 changes: 2 additions & 5 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ exclude = [
"external-crates/move/crates/move-stdlib-natives",
"external-crates/move/crates/move-symbol-pool",
"external-crates/move/crates/move-transactional-test-runner",
"external-crates/move/crates/move-trace-format",
"external-crates/move/crates/move-unit-test",
"external-crates/move/crates/move-vm-config",
"external-crates/move/crates/move-vm-integration-tests",
Expand Down Expand Up @@ -584,6 +585,7 @@ move-symbol-pool = { path = "external-crates/move/crates/move-symbol-pool" }
move-abstract-interpreter = { path = "external-crates/move/crates/move-abstract-interpreter" }
move-abstract-stack = { path = "external-crates/move/crates/move-abstract-stack" }
move-analyzer = { path = "external-crates/move/crates/move-analyzer" }
move-trace-format = { path = "external-crates/move/crates/move-trace-format" }

fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "69d496c71fb37e3d22fe85e5bbfd4256d61422b9" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "69d496c71fb37e3d22fe85e5bbfd4256d61422b9" }
Expand Down
1 change: 1 addition & 0 deletions crates/simulacrum/src/epoch_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl EpochState {
kind,
signer,
tx_digest,
&mut None,
);
Ok((inner_temp_store, gas_status, effects, result))
}
Expand Down
3 changes: 3 additions & 0 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,7 @@ impl AuthorityState {
kind,
signer,
tx_digest,
&mut None,
);

fail_point_if!("cp_execution_nondeterminism", || {
Expand Down Expand Up @@ -1880,6 +1881,7 @@ impl AuthorityState {
kind,
signer,
transaction_digest,
&mut None,
);
let tx_digest = *effects.transaction_digest();

Expand Down Expand Up @@ -2070,6 +2072,7 @@ impl AuthorityState {
kind,
signer,
transaction.digest(),
&mut None,
);

Ok(SimulateTransactionResult {
Expand Down
1 change: 1 addition & 0 deletions crates/sui-genesis-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ fn create_genesis_transaction(
kind,
signer,
genesis_digest,
&mut None,
);
assert!(inner_temp_store.input_objects.is_empty());
assert!(inner_temp_store.mutable_inputs.is_empty());
Expand Down
2 changes: 2 additions & 0 deletions crates/sui-replay/src/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ impl LocalExec {
transaction_kind.clone(),
tx_info.sender,
*tx_digest,
&mut None,
);

if let Err(err) = self.pretty_print_for_tracing(
Expand Down Expand Up @@ -939,6 +940,7 @@ impl LocalExec {
kind,
signer,
*executable.digest(),
&mut None,
);

let effects =
Expand Down
1 change: 1 addition & 0 deletions crates/sui-single-node-benchmark/src/single_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ impl SingleValidator {
kind,
signer,
*executable.digest(),
&mut None,
);
assert!(effects.status().is_ok());
store.commit_objects(inner_temp_store);
Expand Down
1 change: 1 addition & 0 deletions crates/sui-swarm-config/src/network_config_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ mod test {
kind,
signer,
genesis_digest,
&mut None,
);

assert_eq!(&effects, genesis.effects());
Expand Down
17 changes: 1 addition & 16 deletions external-crates/move/crates/move-trace-format/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,15 @@ version = "0.0.1"
authors = ["Move Core Contributors"]
description = "Move Trace Format"
license = "Apache-2.0"
publish = false
edition = "2021"

[dependencies]
anyhow.workspace = true
proptest = { workspace = true, optional = true }
proptest-derive = { workspace = true, optional = true }
ref-cast.workspace = true
variant_count.workspace = true
move-core-types.workspace = true
serde.workspace = true
enum-compat-util.workspace = true
move-proc-macros.workspace = true
move-binary-format.workspace = true

# wasm support (requires js feature of getrandom)
getrandom = { workspace = true, features = ["js"], optional = true }
serde_json = { workspace = true, features = ["arbitrary_precision"] }

[dev-dependencies]
proptest.workspace = true
proptest-derive.workspace = true
move-core-types = { workspace = true, features = ["fuzzing" ] }

[features]
default = []
fuzzing = ["proptest", "proptest-derive", "move-core-types/fuzzing"]
wasm = ["getrandom"]
12 changes: 12 additions & 0 deletions external-crates/move/crates/move-trace-format/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ impl MoveTrace {
}
}

impl Default for MoveTrace {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh clippy...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this clippy note disabled in external-crates fwiw. So we can remove this if we want

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this clippy note disabled in external-crates fwiw. So we can remove this if we want

Fwiw, I got clippy complaining about it in CI...

fn default() -> Self {
Self::new()
}
}

impl MoveTraceBuilder {
/// Create a new `MoveTraceBuilder` with no additional tracing.
pub fn new() -> Self {
Expand Down Expand Up @@ -314,6 +320,12 @@ impl MoveTraceBuilder {
}
}

impl Default for MoveTraceBuilder {
fn default() -> Self {
Self::new()
}
}

impl Display for TraceValue {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ impl TraceState {
}
}

impl Default for TraceState {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fn default() -> Self {
Self::new()
}
}

impl Tracer for TraceState {
fn notify(&mut self, event: &TraceEvent, mut write: Writer<'_>) {
self.apply_event(event);
Expand Down
1 change: 1 addition & 0 deletions sui-execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sui-types.workspace = true

move-binary-format.workspace = true
move-bytecode-verifier-meter.workspace = true
move-trace-format.workspace = true
move-vm-config.workspace = true

sui-adapter-latest = { path = "latest/sui-adapter" }
Expand Down
1 change: 1 addition & 0 deletions sui-execution/latest/sui-adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ move-binary-format.workspace = true
move-bytecode-utils.workspace = true
move-bytecode-verifier-meter.workspace = true
move-core-types.workspace = true
move-trace-format.workspace = true
move-vm-config.workspace = true
move-vm-types.workspace = true
mysten-metrics.workspace = true
Expand Down
Loading
Loading