Skip to content

Commit 4988b62

Browse files
authored
remove aptos consensus from aptos deps (#204)
1 parent 150209d commit 4988b62

File tree

9 files changed

+181
-605
lines changed

9 files changed

+181
-605
lines changed

Cargo.lock

Lines changed: 97 additions & 523 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aptos-move/aptos-debugger/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version = { workspace = true }
1414

1515
[dependencies]
1616
anyhow = { workspace = true }
17-
aptos-consensus = { workspace = true }
17+
# aptos-consensus = { workspace = true }
1818
aptos-crypto = { workspace = true }
1919
aptos-gas-profiling = { workspace = true }
2020
aptos-logger = { workspace = true }

aptos-move/aptos-debugger/src/execute_pending_block.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ impl Command {
6767
info!("GET {url:?}...");
6868
let body = reqwest::get(url).await?.bytes().await?;
6969
bcs::from_bytes(&body)?
70-
} else if let Some(consensus_db_path) = self.consensus_db_path {
71-
info!(
72-
"Getting block {:?} from {consensus_db_path:?}.",
73-
self.block_id
74-
);
75-
let cmd = aptos_consensus::util::db_tool::Command {
76-
db_dir: consensus_db_path,
77-
block_id: self.block_id,
78-
};
79-
cmd.dump_pending_txns()?
80-
} else {
70+
}
71+
// else if let Some(consensus_db_path) = self.consensus_db_path {
72+
// info!(
73+
// "Getting block {:?} from {consensus_db_path:?}.",
74+
// self.block_id
75+
// );
76+
// let cmd = aptos_consensus::util::db_tool::Command {
77+
// db_dir: consensus_db_path,
78+
// block_id: self.block_id,
79+
// };
80+
// cmd.dump_pending_txns()?
81+
// }
82+
else {
8183
unreachable!("Must provide one target.");
8284
};
8385

crates/aptos/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ aptos-gas-schedule = { workspace = true }
2929
aptos-genesis = { workspace = true }
3030
aptos-github-client = { workspace = true }
3131
aptos-global-constants = { workspace = true }
32-
aptos-indexer-grpc-server-framework = { workspace = true }
33-
aptos-indexer-grpc-utils = { workspace = true }
32+
# aptos-indexer-grpc-server-framework = { workspace = true }
33+
# aptos-indexer-grpc-utils = { workspace = true }
3434
aptos-keygen = { workspace = true }
3535
aptos-ledger = { workspace = true }
3636
aptos-logger = { workspace = true }
3737
aptos-move-debugger = { workspace = true }
3838
aptos-network-checker = { workspace = true }
39-
aptos-node = { workspace = true }
39+
# aptos-node = { workspace = true }
4040
aptos-protos = { workspace = true }
4141
aptos-rest-client = { workspace = true }
4242
aptos-sdk = { workspace = true }
4343
aptos-storage-interface = { workspace = true }
44-
aptos-telemetry = { workspace = true }
44+
# aptos-telemetry = { workspace = true }
4545
aptos-temppath = { workspace = true }
4646
aptos-types = { workspace = true }
4747
aptos-vm = { workspace = true, features = ["testing"] }
@@ -83,14 +83,14 @@ pathsearch = { workspace = true }
8383
poem = { workspace = true }
8484
# We set default-features to false so we don't onboard the libpq dep. See more here:
8585
# https://github.com/aptos-labs/aptos-core/pull/12568
86-
processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "5244b84fa5ed872e5280dc8df032d744d62ad29d", default-features = false }
86+
# processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "5244b84fa5ed872e5280dc8df032d744d62ad29d", default-features = false }
8787
rand = { workspace = true }
8888
reqwest = { workspace = true }
8989
self_update = { git = "https://github.com/banool/self_update.git", rev = "8306158ad0fd5b9d4766a3c6bf967e7ef0ea5c4b", features = ["archive-zip", "compression-zip-deflate"] }
9090
serde = { workspace = true }
9191
serde_json = { workspace = true }
9292
serde_yaml = { workspace = true }
93-
server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "5244b84fa5ed872e5280dc8df032d744d62ad29d" }
93+
# server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "5244b84fa5ed872e5280dc8df032d744d62ad29d" }
9494
tempfile = { workspace = true }
9595
thiserror = { workspace = true }
9696
tokio = { workspace = true }
@@ -109,7 +109,7 @@ jemallocator = { workspace = true }
109109
default = []
110110
fuzzing = []
111111
no-upload-proposal = []
112-
indexer = ["aptos-node/indexer"]
112+
# indexer = ["aptos-node/indexer"]
113113
cli-framework-test-move = []
114114

115115
[build-dependencies]

crates/aptos/src/common/utils.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use aptos_crypto::ed25519::{Ed25519PrivateKey, Ed25519PublicKey};
1414
use aptos_keygen::KeyGen;
1515
use aptos_logger::{debug, Level};
1616
use aptos_rest_client::{aptos_api_types::HashValue, Account, Client, FaucetClient, State};
17-
use aptos_telemetry::service::telemetry_is_disabled;
17+
// use aptos_telemetry::service::telemetry_is_disabled;
1818
use aptos_types::{
1919
account_address::create_multisig_account_address,
2020
chain_id::ChainId,
@@ -85,23 +85,23 @@ pub async fn to_common_result<T: Serialize>(
8585
) -> CliResult {
8686
let latency = start_time.elapsed();
8787

88-
if !telemetry_is_disabled() {
89-
let error = if let Err(ref error) = result {
90-
// Only print the error type
91-
Some(error.to_str())
92-
} else {
93-
None
94-
};
95-
96-
if let Err(err) = timeout(
97-
Duration::from_millis(2000),
98-
send_telemetry_event(command, latency, error),
99-
)
100-
.await
101-
{
102-
debug!("send_telemetry_event timeout from CLI: {}", err.to_string())
103-
}
104-
}
88+
// if !telemetry_is_disabled() {
89+
// let error = if let Err(ref error) = result {
90+
// // Only print the error type
91+
// Some(error.to_str())
92+
// } else {
93+
// None
94+
// };
95+
96+
// if let Err(err) = timeout(
97+
// Duration::from_millis(2000),
98+
// send_telemetry_event(command, latency, error),
99+
// )
100+
// .await
101+
// {
102+
// debug!("send_telemetry_event timeout from CLI: {}", err.to_string())
103+
// }
104+
// }
105105

106106
// Return early with a non JSON error if requested.
107107
if let Err(err) = &result {
@@ -130,14 +130,14 @@ async fn send_telemetry_event(command: &str, latency: Duration, error: Option<&s
130130
let build_information = cli_build_information();
131131

132132
// Send the event
133-
aptos_telemetry::cli_metrics::send_cli_telemetry_event(
134-
build_information,
135-
command.into(),
136-
latency,
137-
error.is_none(),
138-
error,
139-
)
140-
.await;
133+
// aptos_telemetry::cli_metrics::send_cli_telemetry_event(
134+
// build_information,
135+
// command.into(),
136+
// latency,
137+
// error.is_none(),
138+
// error,
139+
// )
140+
// .await;
141141
}
142142

143143
/// A result wrapper for displaying either a correct execution result or an error.

crates/aptos/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ pub enum Tool {
4646
Move(move_tool::MoveTool),
4747
#[clap(subcommand)]
4848
Multisig(account::MultisigAccountTool),
49-
#[clap(subcommand)]
50-
Node(node::NodeTool),
49+
// #[clap(subcommand)]
50+
// Node(node::NodeTool),
5151
#[clap(subcommand)]
5252
Stake(stake::StakeTool),
53-
#[clap(subcommand)]
54-
Update(update::UpdateTool),
53+
// #[clap(subcommand)]
54+
// Update(update::UpdateTool),
5555
}
5656

5757
impl Tool {
@@ -68,9 +68,9 @@ impl Tool {
6868
Key(tool) => tool.execute().await,
6969
Move(tool) => tool.execute().await,
7070
Multisig(tool) => tool.execute().await,
71-
Node(tool) => tool.execute().await,
71+
// Node(tool) => tool.execute().await,
7272
Stake(tool) => tool.execute().await,
73-
Update(tool) => tool.execute().await,
73+
// Update(tool) => tool.execute().await,
7474
}
7575
}
7676
}

crates/aptos/src/node/local_testnet/health_checker.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,25 @@ impl HealthChecker {
5656
Ok(())
5757
},
5858
HealthChecker::DataServiceGrpc(url) => {
59-
let mut client = aptos_indexer_grpc_utils::create_data_service_grpc_client(
60-
url.clone(),
61-
Some(Duration::from_secs(5)),
62-
)
63-
.await?;
64-
let request = tonic::Request::new(GetTransactionsRequest {
65-
starting_version: Some(0),
66-
..Default::default()
67-
});
68-
// Make sure we can stream the first message from the stream.
69-
client
70-
.get_transactions(request)
71-
.await
72-
.context("GRPC connection error")?
73-
.into_inner()
74-
.next()
75-
.await
76-
.context("Did not receive init signal from data service GRPC stream")?
77-
.context("Error processing first message from GRPC stream")?;
59+
// let mut client = aptos_indexer_grpc_utils::create_data_service_grpc_client(
60+
// url.clone(),
61+
// Some(Duration::from_secs(5)),
62+
// )
63+
// .await?;
64+
// let request = tonic::Request::new(GetTransactionsRequest {
65+
// starting_version: Some(0),
66+
// ..Default::default()
67+
// });
68+
// // Make sure we can stream the first message from the stream.
69+
// client
70+
// .get_transactions(request)
71+
// .await
72+
// .context("GRPC connection error")?
73+
// .into_inner()
74+
// .next()
75+
// .await
76+
// .context("Did not receive init signal from data service GRPC stream")?
77+
// .context("Error processing first message from GRPC stream")?;
7878
Ok(())
7979
},
8080
HealthChecker::Postgres(connection_string) => {

crates/aptos/src/node/local_testnet/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use crate::{
3636
},
3737
};
3838
use anyhow::{Context, Result};
39-
use aptos_indexer_grpc_server_framework::setup_logging;
39+
// use aptos_indexer_grpc_server_framework::setup_logging;
4040
use async_trait::async_trait;
4141
use clap::Parser;
4242
use std::{
@@ -186,9 +186,9 @@ impl CliCommand<()> for RunLocalnet {
186186
}
187187

188188
async fn execute(mut self) -> CliTypedResult<()> {
189-
if self.log_to_stdout {
190-
setup_logging(None);
191-
}
189+
// if self.log_to_stdout {
190+
// setup_logging(None);
191+
// }
192192

193193
let global_config = GlobalConfig::load().context("Failed to load global config")?;
194194
let test_dir = match &self.test_dir {

crates/aptos/src/node/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
pub mod analyze;
5-
pub mod local_testnet;
5+
// pub mod local_testnet;
66

7-
use self::local_testnet::RunLocalnet;
7+
// use self::local_testnet::RunLocalnet;
88
use crate::{
99
common::{
1010
types::{
@@ -76,8 +76,8 @@ pub enum NodeTool {
7676
ShowValidatorConfig(ShowValidatorConfig),
7777
ShowValidatorSet(ShowValidatorSet),
7878
ShowValidatorStake(ShowValidatorStake),
79-
#[clap(aliases = &["run-local-testnet"])]
80-
RunLocalnet(RunLocalnet),
79+
// #[clap(aliases = &["run-local-testnet"])]
80+
// RunLocalnet(RunLocalnet),
8181
UpdateConsensusKey(UpdateConsensusKey),
8282
UpdateValidatorNetworkAddresses(UpdateValidatorNetworkAddresses),
8383
}
@@ -101,10 +101,10 @@ impl NodeTool {
101101
ShowValidatorSet(tool) => tool.execute_serialized().await,
102102
ShowValidatorStake(tool) => tool.execute_serialized().await,
103103
ShowValidatorConfig(tool) => tool.execute_serialized().await,
104-
RunLocalnet(tool) => tool
105-
.execute_serialized_without_logger()
106-
.await
107-
.map(|_| "".to_string()),
104+
// RunLocalnet(tool) => tool
105+
// .execute_serialized_without_logger()
106+
// .await
107+
// .map(|_| "".to_string()),
108108
UpdateConsensusKey(tool) => tool.execute_serialized().await,
109109
UpdateValidatorNetworkAddresses(tool) => tool.execute_serialized().await,
110110
}

0 commit comments

Comments
 (0)