From 66eab8a698e0107094a444a49cdeba239dd32e9b Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 21 Aug 2024 12:15:48 +0200 Subject: [PATCH] fix(core-node): rename mysten crates (#1954) * fix: renamed paths * fix: renamed code * fix: ran cargo fmt * fix: ran cargo clippy * fix: ran dprint fmt --- .github/crates-filters.yml | 20 +- Cargo.lock | 264 +++++++++--------- Cargo.toml | 20 +- consensus/config/Cargo.toml | 2 +- consensus/config/src/committee.rs | 2 +- consensus/config/src/test_committee.rs | 2 +- consensus/config/tests/committee_test.rs | 2 +- consensus/core/Cargo.toml | 4 +- consensus/core/build.rs | 2 +- consensus/core/src/core.rs | 2 +- consensus/core/src/core_thread.rs | 2 +- .../core/src/network/connection_monitor.rs | 2 +- consensus/core/src/network/tonic_network.rs | 2 +- consensus/core/src/synchronizer.rs | 2 +- consensus/core/src/transaction.rs | 2 +- crates/iota-analytics-indexer/Cargo.toml | 2 +- crates/iota-analytics-indexer/src/main.rs | 4 +- crates/iota-authority-aggregation/Cargo.toml | 2 +- crates/iota-authority-aggregation/src/lib.rs | 2 +- crates/iota-aws-orchestrator/Cargo.toml | 2 +- .../src/protocol/iota.rs | 4 +- .../src/protocol/narwhal.rs | 2 +- crates/iota-benchmark/Cargo.toml | 2 +- crates/iota-benchmark/src/bin/stress.rs | 4 +- .../src/embedded_reconfig_observer.rs | 4 +- crates/iota-benchmark/src/lib.rs | 2 +- .../{mysten-common => iota-common}/Cargo.toml | 2 +- .../{mysten-common => iota-common}/src/lib.rs | 0 .../src/sync/async_once_cell.rs | 0 .../src/sync/mod.rs | 0 .../src/sync/notify_once.rs | 0 .../src/sync/notify_read.rs | 0 crates/iota-core/Cargo.toml | 6 +- crates/iota-core/src/authority.rs | 8 +- .../authority/authority_per_epoch_store.rs | 4 +- .../src/authority/authority_store.rs | 2 +- .../src/authority/authority_store_pruner.rs | 2 +- crates/iota-core/src/authority_aggregator.rs | 12 +- crates/iota-core/src/authority_client.rs | 8 +- crates/iota-core/src/authority_server.rs | 4 +- .../checkpoint_executor/metrics.rs | 2 +- .../checkpoints/checkpoint_executor/mod.rs | 2 +- crates/iota-core/src/checkpoints/metrics.rs | 2 +- crates/iota-core/src/checkpoints/mod.rs | 6 +- crates/iota-core/src/consensus_adapter.rs | 6 +- crates/iota-core/src/consensus_handler.rs | 2 +- crates/iota-core/src/consensus_manager/mod.rs | 2 +- .../consensus_manager/mysticeti_manager.rs | 2 +- .../src/consensus_manager/narwhal_manager.rs | 2 +- crates/iota-core/src/consensus_validator.rs | 2 +- crates/iota-core/src/epoch/data_removal.rs | 2 +- .../src/execution_cache/passthrough_cache.rs | 2 +- .../src/execution_cache/writeback_cache.rs | 2 +- crates/iota-core/src/execution_driver.rs | 2 +- .../src/post_consensus_tx_reorder.rs | 2 +- crates/iota-core/src/quorum_driver/metrics.rs | 2 +- crates/iota-core/src/quorum_driver/mod.rs | 8 +- crates/iota-core/src/quorum_driver/tests.rs | 2 +- crates/iota-core/src/safe_client.rs | 2 +- crates/iota-core/src/scoring_decision.rs | 2 +- crates/iota-core/src/signature_verifier.rs | 2 +- crates/iota-core/src/state_accumulator.rs | 2 +- crates/iota-core/src/streamer.rs | 10 +- .../iota-core/src/test_authority_clients.rs | 2 +- crates/iota-core/src/transaction_manager.rs | 2 +- .../iota-core/src/transaction_orchestrator.rs | 12 +- .../src/unit_tests/consensus_tests.rs | 2 +- .../src/unit_tests/mysticeti_manager_tests.rs | 2 +- .../src/unit_tests/narwhal_manager_tests.rs | 4 +- .../src/unit_tests/transaction_tests.rs | 2 +- crates/iota-data-ingestion-core/Cargo.toml | 2 +- .../iota-data-ingestion-core/src/executor.rs | 2 +- crates/iota-data-ingestion-core/src/reader.rs | 2 +- .../src/worker_pool.rs | 2 +- crates/iota-data-ingestion/Cargo.toml | 2 +- crates/iota-data-ingestion/src/main.rs | 4 +- crates/iota-e2e-tests/Cargo.toml | 2 +- crates/iota-faucet/Cargo.toml | 2 +- .../iota-faucet/src/faucet/simple_faucet.rs | 2 +- crates/iota-faucet/src/main.rs | 4 +- crates/iota-graphql-rpc/Cargo.toml | 4 +- crates/iota-graphql-rpc/src/server/builder.rs | 10 +- crates/iota-graphql-rpc/src/server/version.rs | 4 +- crates/iota-indexer/Cargo.toml | 2 +- crates/iota-indexer/src/framework/builder.rs | 10 +- crates/iota-indexer/src/framework/fetcher.rs | 4 +- .../src/handlers/checkpoint_handler.rs | 6 +- crates/iota-indexer/src/handlers/committer.rs | 4 +- .../iota-indexer/src/handlers/tx_processor.rs | 2 +- crates/iota-indexer/src/indexer.rs | 10 +- crates/iota-indexer/src/main.rs | 2 +- crates/iota-indexer/src/metrics.rs | 2 +- crates/iota-indexer/src/test_utils.rs | 2 +- crates/iota-json-rpc-api/Cargo.toml | 2 +- crates/iota-json-rpc-api/src/lib.rs | 2 +- crates/iota-json-rpc-types/Cargo.toml | 2 +- crates/iota-json-rpc-types/src/iota_event.rs | 2 +- .../src/iota_transaction.rs | 2 +- crates/iota-json-rpc/Cargo.toml | 2 +- crates/iota-json-rpc/src/coin_api.rs | 2 +- crates/iota-json-rpc/src/governance_api.rs | 2 +- crates/iota-json-rpc/src/indexer_api.rs | 2 +- crates/iota-json-rpc/src/read_api.rs | 2 +- .../src/transaction_execution_api.rs | 2 +- .../Cargo.toml | 2 +- .../src/guards.rs | 0 .../src/histogram.rs | 0 .../src/lib.rs | 16 +- .../src/metered_channel.rs | 0 .../src/tests/metered_channel_tests.rs | 0 crates/iota-move/Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../src/anemo_ext.rs | 0 .../src/callback/future.rs | 0 .../src/callback/layer.rs | 0 .../src/callback/mod.rs | 0 .../src/callback/service.rs | 0 .../src/client.rs | 0 .../src/codec.rs | 0 .../src/config.rs | 0 .../src/lib.rs | 0 .../src/metrics.rs | 0 .../src/multiaddr.rs | 0 .../src/server.rs | 0 crates/iota-network/Cargo.toml | 4 +- crates/iota-network/build.rs | 4 +- crates/iota-network/src/lib.rs | 6 +- crates/iota-network/src/randomness/mod.rs | 4 +- crates/iota-network/src/state_sync/metrics.rs | 2 +- crates/iota-node/Cargo.toml | 6 +- crates/iota-node/src/lib.rs | 8 +- crates/iota-node/src/main.rs | 6 +- crates/iota-node/src/metrics.rs | 4 +- crates/iota-rosetta/Cargo.toml | 2 +- crates/iota-rosetta/src/lib.rs | 2 +- crates/iota-rosetta/src/main.rs | 2 +- .../iota-source-validation-service/Cargo.toml | 2 +- .../iota-source-validation-service/src/lib.rs | 4 +- crates/iota-storage/Cargo.toml | 2 +- crates/iota-storage/src/mutex_table.rs | 2 +- crates/iota-swarm/Cargo.toml | 4 +- crates/iota-swarm/src/memory/container-sim.rs | 2 +- crates/iota-swarm/src/memory/container.rs | 2 +- crates/iota-swarm/src/memory/node.rs | 2 +- crates/iota-tool/src/lib.rs | 4 +- crates/iota-types/Cargo.toml | 4 +- .../epoch_start_iota_system_state.rs | 2 +- .../simtest_iota_system_state_inner.rs | 2 +- crates/iota-types/src/lib.rs | 2 +- crates/iota-types/src/messages_checkpoint.rs | 2 +- .../Cargo.toml | 2 +- .../lib.rs | 12 +- .../Cargo.toml | 4 +- .../README.md | 6 +- .../src/allocators.rs | 0 .../src/external_impls.rs | 0 .../src/lib.rs | 2 +- .../src/malloc_size.rs | 4 +- .../src/memory_stats_noop.rs | 0 .../src/sizeof.rs | 0 .../tests/derive.rs | 2 +- narwhal/config/Cargo.toml | 4 +- narwhal/config/src/committee.rs | 6 +- narwhal/config/src/lib.rs | 2 +- narwhal/config/tests/config_tests.rs | 2 +- narwhal/executor/Cargo.toml | 2 +- narwhal/executor/src/lib.rs | 2 +- narwhal/executor/src/subscriber.rs | 2 +- narwhal/network/Cargo.toml | 4 +- narwhal/network/src/admin.rs | 2 +- narwhal/network/src/client.rs | 2 +- narwhal/network/src/connectivity.rs | 2 +- narwhal/node/Cargo.toml | 4 +- narwhal/node/src/benchmark_client.rs | 6 +- narwhal/node/src/generate_format.rs | 2 +- narwhal/node/src/main.rs | 8 +- narwhal/node/src/metrics.rs | 4 +- narwhal/node/src/primary_node.rs | 2 +- narwhal/node/src/worker_node.rs | 2 +- narwhal/node/tests/node_test.rs | 2 +- narwhal/primary/Cargo.toml | 6 +- narwhal/primary/src/certificate_fetcher.rs | 2 +- narwhal/primary/src/certifier.rs | 4 +- narwhal/primary/src/consensus/metrics.rs | 2 +- narwhal/primary/src/consensus/state.rs | 2 +- narwhal/primary/src/primary.rs | 6 +- narwhal/primary/src/proposer.rs | 2 +- narwhal/primary/src/state_handler.rs | 2 +- narwhal/primary/src/synchronizer.rs | 10 +- narwhal/primary/src/tests/primary_tests.rs | 8 +- narwhal/storage/Cargo.toml | 2 +- narwhal/storage/src/certificate_store.rs | 2 +- narwhal/storage/src/payload_store.rs | 2 +- narwhal/test-utils/Cargo.toml | 4 +- narwhal/test-utils/src/cluster.rs | 6 +- narwhal/test-utils/src/lib.rs | 8 +- narwhal/types/Cargo.toml | 8 +- narwhal/types/build.rs | 2 +- narwhal/types/src/error.rs | 2 +- narwhal/types/src/primary.rs | 2 +- narwhal/types/src/tests/error_test.rs | 2 +- narwhal/worker/Cargo.toml | 4 +- narwhal/worker/src/batch_maker.rs | 2 +- narwhal/worker/src/client.rs | 4 +- narwhal/worker/src/metrics.rs | 2 +- narwhal/worker/src/quorum_waiter.rs | 2 +- narwhal/worker/src/tests/worker_tests.rs | 4 +- narwhal/worker/src/transactions_server.rs | 6 +- narwhal/worker/src/worker.rs | 4 +- 209 files changed, 458 insertions(+), 464 deletions(-) rename crates/{mysten-common => iota-common}/Cargo.toml (93%) rename crates/{mysten-common => iota-common}/src/lib.rs (100%) rename crates/{mysten-common => iota-common}/src/sync/async_once_cell.rs (100%) rename crates/{mysten-common => iota-common}/src/sync/mod.rs (100%) rename crates/{mysten-common => iota-common}/src/sync/notify_once.rs (100%) rename crates/{mysten-common => iota-common}/src/sync/notify_read.rs (100%) rename crates/{mysten-metrics => iota-metrics}/Cargo.toml (95%) rename crates/{mysten-metrics => iota-metrics}/src/guards.rs (100%) rename crates/{mysten-metrics => iota-metrics}/src/histogram.rs (100%) rename crates/{mysten-metrics => iota-metrics}/src/lib.rs (96%) rename crates/{mysten-metrics => iota-metrics}/src/metered_channel.rs (100%) rename crates/{mysten-metrics => iota-metrics}/src/tests/metered_channel_tests.rs (100%) rename crates/{mysten-network => iota-network-stack}/Cargo.toml (96%) rename crates/{mysten-network => iota-network-stack}/src/anemo_ext.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/callback/future.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/callback/layer.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/callback/mod.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/callback/service.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/client.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/codec.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/config.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/lib.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/metrics.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/multiaddr.rs (100%) rename crates/{mysten-network => iota-network-stack}/src/server.rs (100%) rename crates/{mysten-util-mem-derive => iota-util-mem-derive}/Cargo.toml (92%) rename crates/{mysten-util-mem-derive => iota-util-mem-derive}/lib.rs (85%) rename crates/{mysten-util-mem => iota-util-mem}/Cargo.toml (93%) rename crates/{mysten-util-mem => iota-util-mem}/README.md (86%) rename crates/{mysten-util-mem => iota-util-mem}/src/allocators.rs (100%) rename crates/{mysten-util-mem => iota-util-mem}/src/external_impls.rs (100%) rename crates/{mysten-util-mem => iota-util-mem}/src/lib.rs (99%) rename crates/{mysten-util-mem => iota-util-mem}/src/malloc_size.rs (99%) rename crates/{mysten-util-mem => iota-util-mem}/src/memory_stats_noop.rs (100%) rename crates/{mysten-util-mem => iota-util-mem}/src/sizeof.rs (100%) rename crates/{mysten-util-mem => iota-util-mem}/tests/derive.rs (97%) diff --git a/.github/crates-filters.yml b/.github/crates-filters.yml index 7ead91d469b..c7934c7d9ac 100644 --- a/.github/crates-filters.yml +++ b/.github/crates-filters.yml @@ -2,16 +2,16 @@ consensus-config: - "consensus/config/**" consensus-core: - "consensus/core/**" -mysten-common: - - "crates/mysten-common/**" -mysten-metrics: - - "crates/mysten-metrics/**" -mysten-network: - - "crates/mysten-network/**" -mysten-util-mem: - - "crates/mysten-util-mem/**" -mysten-util-mem-derive: - - "crates/mysten-util-mem-derive/**" +iota-common: + - "crates/iota-common/**" +iota-metrics: + - "crates/iota-metrics/**" +iota-network-stack: + - "crates/iota-network-stack/**" +iota-util-mem: + - "crates/iota-util-mem/**" +iota-util-mem-derive: + - "crates/iota-util-mem-derive/**" prometheus-closure-metric: - "crates/prometheus-closure-metric/**" shared-crypto: diff --git a/Cargo.lock b/Cargo.lock index bad18fa327e..70bc5dd23f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2564,7 +2564,7 @@ version = "0.1.0" dependencies = [ "fastcrypto", "insta", - "mysten-network", + "iota-network-stack", "rand", "serde", "shared-crypto", @@ -2589,10 +2589,10 @@ dependencies = [ "enum_dispatch", "fastcrypto", "futures", + "iota-metrics", + "iota-network-stack", "iota-protocol-config", "mockall", - "mysten-metrics", - "mysten-network", "parking_lot 0.12.3", "prometheus", "prost 0.13.1", @@ -5246,6 +5246,7 @@ dependencies = [ "iota-config", "iota-indexer", "iota-json-rpc-types", + "iota-metrics", "iota-package-resolver", "iota-rest-api", "iota-storage", @@ -5253,7 +5254,6 @@ dependencies = [ "move-binary-format", "move-bytecode-utils", "move-core-types", - "mysten-metrics", "num_enum", "object_store", "parquet", @@ -5322,8 +5322,8 @@ name = "iota-authority-aggregation" version = "0.1.0" dependencies = [ "futures", + "iota-metrics", "iota-types", - "mysten-metrics", "tokio", "tracing", ] @@ -5344,9 +5344,9 @@ dependencies = [ "eyre", "futures", "iota-config", + "iota-metrics", "iota-swarm-config", "iota-types", - "mysten-metrics", "narwhal-config", "prettytable-rs", "prometheus-parse", @@ -5381,6 +5381,7 @@ dependencies = [ "iota-json-rpc-types", "iota-keys", "iota-macros", + "iota-metrics", "iota-network", "iota-protocol-config", "iota-sdk 0.1.4", @@ -5391,7 +5392,6 @@ dependencies = [ "iota-types", "itertools 0.13.0", "move-core-types", - "mysten-metrics", "narwhal-node", "prometheus", "rand", @@ -5448,6 +5448,15 @@ dependencies = [ "uuid", ] +[[package]] +name = "iota-common" +version = "0.1.0" +dependencies = [ + "futures", + "parking_lot 0.12.3", + "tokio", +] + [[package]] name = "iota-config" version = "0.0.0" @@ -5504,14 +5513,17 @@ dependencies = [ "indexmap 2.3.0", "iota-archival", "iota-authority-aggregation", + "iota-common", "iota-config", "iota-execution", "iota-framework", "iota-genesis-builder", "iota-json-rpc-types", "iota-macros", + "iota-metrics", "iota-move-build", "iota-network", + "iota-network-stack", "iota-protocol-config", "iota-simulator", "iota-storage", @@ -5529,9 +5541,6 @@ dependencies = [ "move-core-types", "move-package", "move-symbol-pool", - "mysten-common", - "mysten-metrics", - "mysten-network", "narwhal-config", "narwhal-crypto", "narwhal-executor", @@ -5647,9 +5656,9 @@ dependencies = [ "futures", "iota-archival", "iota-data-ingestion-core", + "iota-metrics", "iota-storage", "iota-types", - "mysten-metrics", "notify", "object_store", "prometheus", @@ -5672,9 +5681,9 @@ dependencies = [ "async-trait", "backoff", "futures", + "iota-metrics", "iota-storage", "iota-types", - "mysten-metrics", "notify", "object_store", "prometheus", @@ -5712,6 +5721,7 @@ dependencies = [ "iota-json-rpc-types", "iota-keys", "iota-macros", + "iota-metrics", "iota-move-build", "iota-node", "iota-protocol-config", @@ -5727,7 +5737,6 @@ dependencies = [ "move-binary-format", "move-core-types", "move-package", - "mysten-metrics", "prometheus", "rand", "serde", @@ -5798,9 +5807,9 @@ dependencies = [ "iota-config", "iota-json-rpc-types", "iota-keys", + "iota-metrics", "iota-sdk 0.1.4", "iota-types", - "mysten-metrics", "parking_lot 0.12.3", "prometheus", "rocksdb", @@ -5972,6 +5981,8 @@ dependencies = [ "iota-indexer", "iota-json-rpc", "iota-json-rpc-types", + "iota-metrics", + "iota-network-stack", "iota-package-resolver", "iota-protocol-config", "iota-rest-api", @@ -5985,8 +5996,6 @@ dependencies = [ "move-core-types", "move-disassembler", "move-ir-types", - "mysten-metrics", - "mysten-network", "once_cell", "prometheus", "rand", @@ -6054,6 +6063,7 @@ dependencies = [ "iota-json-rpc-api", "iota-json-rpc-types", "iota-keys", + "iota-metrics", "iota-move-build", "iota-open-rpc", "iota-package-resolver", @@ -6066,7 +6076,6 @@ dependencies = [ "move-binary-format", "move-bytecode-utils", "move-core-types", - "mysten-metrics", "prometheus", "regex", "serde", @@ -6121,6 +6130,7 @@ dependencies = [ "iota-json", "iota-json-rpc-api", "iota-json-rpc-types", + "iota-metrics", "iota-open-rpc", "iota-open-rpc-macros", "iota-protocol-config", @@ -6134,7 +6144,6 @@ dependencies = [ "move-bytecode-utils", "move-core-types", "move-package", - "mysten-metrics", "once_cell", "prometheus", "serde", @@ -6159,11 +6168,11 @@ dependencies = [ "fastcrypto", "iota-json", "iota-json-rpc-types", + "iota-metrics", "iota-open-rpc", "iota-open-rpc-macros", "iota-types", "jsonrpsee", - "mysten-metrics", "once_cell", "prometheus", "tap", @@ -6218,6 +6227,7 @@ dependencies = [ "iota-enum-compat-util", "iota-json", "iota-macros", + "iota-metrics", "iota-protocol-config", "iota-types", "itertools 0.13.0", @@ -6225,7 +6235,6 @@ dependencies = [ "move-binary-format", "move-bytecode-utils", "move-core-types", - "mysten-metrics", "schemars", "serde", "serde_json", @@ -6308,6 +6317,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "iota-metrics" +version = "0.7.0" +dependencies = [ + "async-trait", + "axum 0.7.5", + "dashmap 6.0.1", + "futures", + "once_cell", + "parking_lot 0.12.3", + "prometheus", + "prometheus-closure-metric", + "scopeguard", + "tap", + "tokio", + "tracing", + "uuid", +] + [[package]] name = "iota-move" version = "0.1.4" @@ -6319,6 +6347,7 @@ dependencies = [ "futures", "git-version", "iota-macros", + "iota-metrics", "iota-move-build", "iota-move-natives-latest", "iota-protocol-config", @@ -6332,7 +6361,6 @@ dependencies = [ "move-prover", "move-unit-test", "move-vm-runtime", - "mysten-metrics", "once_cell", "prometheus", "rand", @@ -6424,11 +6452,11 @@ dependencies = [ "governor", "iota-archival", "iota-config", + "iota-metrics", + "iota-network-stack", "iota-storage", "iota-swarm-config", "iota-types", - "mysten-metrics", - "mysten-network", "prometheus", "rand", "serde", @@ -6442,6 +6470,30 @@ dependencies = [ "tracing", ] +[[package]] +name = "iota-network-stack" +version = "0.2.0" +dependencies = [ + "anemo", + "bcs", + "bytes", + "eyre", + "futures", + "http 1.1.0", + "hyper-util", + "multiaddr", + "pin-project-lite", + "serde", + "snap", + "tokio", + "tokio-stream", + "tonic 0.12.1", + "tonic-health", + "tower", + "tower-http", + "tracing", +] + [[package]] name = "iota-node" version = "0.1.4" @@ -6459,12 +6511,15 @@ dependencies = [ "git-version", "humantime", "iota-archival", + "iota-common", "iota-config", "iota-core", "iota-json-rpc", "iota-json-rpc-api", "iota-macros", + "iota-metrics", "iota-network", + "iota-network-stack", "iota-protocol-config", "iota-rest-api", "iota-simulator", @@ -6472,9 +6527,6 @@ dependencies = [ "iota-storage", "iota-types", "move-vm-profiler", - "mysten-common", - "mysten-metrics", - "mysten-network", "narwhal-network", "narwhal-worker", "prometheus", @@ -6661,13 +6713,13 @@ dependencies = [ "iota-config", "iota-json-rpc-types", "iota-keys", + "iota-metrics", "iota-move-build", "iota-node", "iota-sdk 0.1.4", "iota-swarm-config", "iota-types", "move-core-types", - "mysten-metrics", "once_cell", "rand", "reqwest 0.12.5", @@ -6915,6 +6967,7 @@ dependencies = [ "hyper 1.4.1", "iota", "iota-json-rpc-types", + "iota-metrics", "iota-move", "iota-move-build", "iota-sdk 0.1.4", @@ -6924,7 +6977,6 @@ dependencies = [ "move-core-types", "move-package", "move-symbol-pool", - "mysten-metrics", "prometheus", "reqwest 0.12.5", "serde", @@ -6964,6 +7016,7 @@ dependencies = [ "iota-config", "iota-json-rpc-types", "iota-macros", + "iota-metrics", "iota-protocol-config", "iota-test-transaction-builder", "iota-types", @@ -6972,7 +7025,6 @@ dependencies = [ "move-binary-format", "move-bytecode-utils", "move-core-types", - "mysten-metrics", "num_enum", "object_store", "once_cell", @@ -7030,13 +7082,13 @@ dependencies = [ "futures", "iota-config", "iota-macros", + "iota-metrics", + "iota-network-stack", "iota-node", "iota-protocol-config", "iota-simulator", "iota-swarm-config", "iota-types", - "mysten-metrics", - "mysten-network", "prometheus", "rand", "tap", @@ -7256,6 +7308,8 @@ dependencies = [ "indexmap 2.3.0", "iota-enum-compat-util", "iota-macros", + "iota-metrics", + "iota-network-stack", "iota-protocol-config", "iota-sdk 1.1.5", "itertools 0.13.0", @@ -7268,8 +7322,6 @@ dependencies = [ "move-vm-profiler", "move-vm-test-utils", "move-vm-types", - "mysten-metrics", - "mysten-network", "narwhal-config", "narwhal-crypto", "num-bigint 0.4.6", @@ -7313,6 +7365,34 @@ dependencies = [ "move-package", ] +[[package]] +name = "iota-util-mem" +version = "0.11.0" +dependencies = [ + "cfg-if", + "ed25519-consensus", + "fastcrypto", + "fastcrypto-tbls", + "hashbrown 0.14.5", + "impl-trait-for-tuples", + "indexmap 2.3.0", + "iota-util-mem-derive", + "lru", + "once_cell", + "parking_lot 0.12.3", + "roaring", + "smallvec", +] + +[[package]] +name = "iota-util-mem-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "iota-verifier-latest" version = "0.1.0" @@ -8977,86 +9057,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" -[[package]] -name = "mysten-common" -version = "0.1.0" -dependencies = [ - "futures", - "parking_lot 0.12.3", - "tokio", -] - -[[package]] -name = "mysten-metrics" -version = "0.7.0" -dependencies = [ - "async-trait", - "axum 0.7.5", - "dashmap 6.0.1", - "futures", - "once_cell", - "parking_lot 0.12.3", - "prometheus", - "prometheus-closure-metric", - "scopeguard", - "tap", - "tokio", - "tracing", - "uuid", -] - -[[package]] -name = "mysten-network" -version = "0.2.0" -dependencies = [ - "anemo", - "bcs", - "bytes", - "eyre", - "futures", - "http 1.1.0", - "hyper-util", - "multiaddr", - "pin-project-lite", - "serde", - "snap", - "tokio", - "tokio-stream", - "tonic 0.12.1", - "tonic-health", - "tower", - "tower-http", - "tracing", -] - -[[package]] -name = "mysten-util-mem" -version = "0.11.0" -dependencies = [ - "cfg-if", - "ed25519-consensus", - "fastcrypto", - "fastcrypto-tbls", - "hashbrown 0.14.5", - "impl-trait-for-tuples", - "indexmap 2.3.0", - "lru", - "mysten-util-mem-derive", - "once_cell", - "parking_lot 0.12.3", - "roaring", - "smallvec", -] - -[[package]] -name = "mysten-util-mem-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "naive-timer" version = "0.2.0" @@ -9082,9 +9082,9 @@ version = "0.1.0" dependencies = [ "fastcrypto", "insta", + "iota-network-stack", + "iota-util-mem", "match_opt", - "mysten-network", - "mysten-util-mem", "narwhal-crypto", "narwhal-test-utils", "rand", @@ -9119,9 +9119,9 @@ dependencies = [ "fastcrypto", "futures", "indexmap 2.3.0", + "iota-metrics", "iota-protocol-config", "mockall", - "mysten-metrics", "narwhal-config", "narwhal-crypto", "narwhal-network", @@ -9156,9 +9156,9 @@ dependencies = [ "bytes", "dashmap 6.0.1", "futures", + "iota-common", "iota-macros", - "mysten-common", - "mysten-metrics", + "iota-metrics", "narwhal-crypto", "narwhal-types", "parking_lot 0.12.3", @@ -9185,11 +9185,11 @@ dependencies = [ "fastcrypto", "futures", "iota-keys", + "iota-metrics", + "iota-network-stack", "iota-protocol-config", "iota-types", "move-bytecode-utils", - "mysten-metrics", - "mysten-network", "narwhal-config", "narwhal-crypto", "narwhal-executor", @@ -9235,13 +9235,13 @@ dependencies = [ "futures", "governor", "indexmap 2.3.0", + "iota-common", "iota-macros", + "iota-metrics", + "iota-network-stack", "iota-protocol-config", "itertools 0.13.0", "mockall", - "mysten-common", - "mysten-metrics", - "mysten-network", "narwhal-config", "narwhal-crypto", "narwhal-executor", @@ -9275,9 +9275,9 @@ dependencies = [ "fastcrypto", "fastcrypto-tbls", "futures", + "iota-common", "iota-macros", "lru", - "mysten-common", "narwhal-config", "narwhal-test-utils", "narwhal-types", @@ -9298,10 +9298,10 @@ dependencies = [ "fastcrypto", "fdlimit", "indexmap 2.3.0", + "iota-metrics", + "iota-network-stack", "iota-protocol-config", "itertools 0.13.0", - "mysten-metrics", - "mysten-network", "narwhal-config", "narwhal-crypto", "narwhal-executor", @@ -9338,11 +9338,11 @@ dependencies = [ "fastcrypto", "futures", "indexmap 2.3.0", + "iota-common", + "iota-metrics", + "iota-network-stack", + "iota-util-mem", "mockall", - "mysten-common", - "mysten-metrics", - "mysten-network", - "mysten-util-mem", "narwhal-config", "narwhal-crypto", "narwhal-test-utils", @@ -9382,9 +9382,9 @@ dependencies = [ "fastcrypto", "futures", "governor", + "iota-metrics", + "iota-network-stack", "itertools 0.13.0", - "mysten-metrics", - "mysten-network", "narwhal-config", "narwhal-crypto", "narwhal-network", diff --git a/Cargo.toml b/Cargo.toml index 033bd7dc8ff..d13d404cf89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,7 @@ members = [ "crates/iota-aws-orchestrator", "crates/iota-benchmark", "crates/iota-cluster-test", + "crates/iota-common", "crates/iota-config", "crates/iota-core", "crates/iota-cost", @@ -99,9 +100,11 @@ members = [ "crates/iota-light-client", "crates/iota-macros", "crates/iota-metric-checker", + "crates/iota-metrics", "crates/iota-move", "crates/iota-move-build", "crates/iota-network", + "crates/iota-network-stack", "crates/iota-node", "crates/iota-open-rpc", "crates/iota-open-rpc-macros", @@ -131,12 +134,9 @@ members = [ "crates/iota-transactional-test-runner", "crates/iota-types", "crates/iota-upgrade-compatibility-transactional-tests", + "crates/iota-util-mem", + "crates/iota-util-mem-derive", "crates/iota-verifier-transactional-tests", - "crates/mysten-common", - "crates/mysten-metrics", - "crates/mysten-network", - "crates/mysten-util-mem", - "crates/mysten-util-mem-derive", "crates/prometheus-closure-metric", "crates/shared-crypto", "crates/simulacrum", @@ -363,6 +363,7 @@ iota-archival = { path = "crates/iota-archival" } iota-authority-aggregation = { path = "crates/iota-authority-aggregation" } iota-benchmark = { path = "crates/iota-benchmark" } iota-cluster-test = { path = "crates/iota-cluster-test" } +iota-common = { path = "crates/iota-common" } iota-config = { path = "crates/iota-config" } iota-core = { path = "crates/iota-core" } iota-cost = { path = "crates/iota-cost" } @@ -386,9 +387,11 @@ iota-json-rpc-types = { path = "crates/iota-json-rpc-types" } iota-keys = { path = "crates/iota-keys" } iota-macros = { path = "crates/iota-macros" } iota-metric-checker = { path = "crates/iota-metric-checker" } +iota-metrics = { path = "crates/iota-metrics" } iota-move = { path = "crates/iota-move" } iota-move-build = { path = "crates/iota-move-build" } iota-network = { path = "crates/iota-network" } +iota-network-stack = { path = "crates/iota-network-stack" } iota-node = { path = "crates/iota-node" } iota-open-rpc = { path = "crates/iota-open-rpc" } iota-open-rpc-macros = { path = "crates/iota-open-rpc-macros" } @@ -417,12 +420,9 @@ iota-transaction-checks = { path = "crates/iota-transaction-checks" } iota-transactional-test-runner = { path = "crates/iota-transactional-test-runner" } iota-types = { path = "crates/iota-types" } iota-upgrade-compatibility-transactional-tests = { path = "crates/iota-upgrade-compatibility-transactional-tests" } +iota-util-mem = { path = "crates/iota-util-mem" } +iota-util-mem-derive = { path = "crates/iota-util-mem-derive" } iota-verifier-transactional-tests = { path = "crates/iota-verifier-transactional-tests" } -mysten-common = { path = "crates/mysten-common" } -mysten-metrics = { path = "crates/mysten-metrics" } -mysten-network = { path = "crates/mysten-network" } -mysten-util-mem = { path = "crates/mysten-util-mem" } -mysten-util-mem-derive = { path = "crates/mysten-util-mem-derive" } prometheus-closure-metric = { path = "crates/prometheus-closure-metric" } shared-crypto = { path = "crates/shared-crypto" } simulacrum = { path = "crates/simulacrum" } diff --git a/consensus/config/Cargo.toml b/consensus/config/Cargo.toml index f2d3112019b..b2f67595353 100644 --- a/consensus/config/Cargo.toml +++ b/consensus/config/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] fastcrypto.workspace = true -mysten-network.workspace = true +iota-network-stack.workspace = true rand.workspace = true serde.workspace = true shared-crypto.workspace = true diff --git a/consensus/config/src/committee.rs b/consensus/config/src/committee.rs index 41e3bd5cc89..7017679f436 100644 --- a/consensus/config/src/committee.rs +++ b/consensus/config/src/committee.rs @@ -7,7 +7,7 @@ use std::{ ops::{Index, IndexMut}, }; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use serde::{Deserialize, Serialize}; use crate::{AuthorityPublicKey, NetworkPublicKey, ProtocolPublicKey}; diff --git a/consensus/config/src/test_committee.rs b/consensus/config/src/test_committee.rs index 55663b9b18e..f232076fd2d 100644 --- a/consensus/config/src/test_committee.rs +++ b/consensus/config/src/test_committee.rs @@ -4,7 +4,7 @@ use std::net::{TcpListener, TcpStream}; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use rand::{rngs::StdRng, SeedableRng as _}; use crate::{ diff --git a/consensus/config/tests/committee_test.rs b/consensus/config/tests/committee_test.rs index b4dd6f2edd8..2a288d20276 100644 --- a/consensus/config/tests/committee_test.rs +++ b/consensus/config/tests/committee_test.rs @@ -6,7 +6,7 @@ use consensus_config::{ Authority, AuthorityKeyPair, Committee, NetworkKeyPair, ProtocolKeyPair, Stake, }; use insta::assert_yaml_snapshot; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use rand::{rngs::StdRng, SeedableRng as _}; // Committee is not sent over network or stored on disk itself, but some of its diff --git a/consensus/core/Cargo.toml b/consensus/core/Cargo.toml index 1e1dbc9978f..299fcc75298 100644 --- a/consensus/core/Cargo.toml +++ b/consensus/core/Cargo.toml @@ -21,10 +21,10 @@ dashmap.workspace = true enum_dispatch.workspace = true fastcrypto.workspace = true futures.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true iota-protocol-config.workspace = true mockall.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true parking_lot.workspace = true prometheus.workspace = true prost.workspace = true diff --git a/consensus/core/build.rs b/consensus/core/build.rs index ccdd3c65ff7..2ce9beff58b 100644 --- a/consensus/core/build.rs +++ b/consensus/core/build.rs @@ -56,7 +56,7 @@ fn build_anemo_services(out_dir: &Path) { let mut automock_attribute = anemo_build::Attributes::default(); automock_attribute.push_trait(".", r#"#[mockall::automock]"#); - let codec_path = "mysten_network::codec::anemo::BcsSnappyCodec"; + let codec_path = "iota_network_stack::codec::anemo::BcsSnappyCodec"; let service = anemo_build::manual::Service::builder() .name("ConsensusRpc") diff --git a/consensus/core/src/core.rs b/consensus/core/src/core.rs index 7e12ae9fbe2..88e64a4fe4c 100644 --- a/consensus/core/src/core.rs +++ b/consensus/core/src/core.rs @@ -9,7 +9,7 @@ use std::{ }; use consensus_config::ProtocolKeyPair; -use mysten_metrics::monitored_scope; +use iota_metrics::monitored_scope; use parking_lot::RwLock; use tokio::sync::{broadcast, watch}; use tracing::{debug, info, warn}; diff --git a/consensus/core/src/core_thread.rs b/consensus/core/src/core_thread.rs index 2353a724a23..6145e9fdc9a 100644 --- a/consensus/core/src/core_thread.rs +++ b/consensus/core/src/core_thread.rs @@ -5,7 +5,7 @@ use std::{collections::BTreeSet, fmt::Debug, sync::Arc}; use async_trait::async_trait; -use mysten_metrics::{metered_channel, monitored_scope, spawn_logged_monitored_task}; +use iota_metrics::{metered_channel, monitored_scope, spawn_logged_monitored_task}; use thiserror::Error; use tokio::sync::{oneshot, oneshot::error::RecvError}; use tracing::warn; diff --git a/consensus/core/src/network/connection_monitor.rs b/consensus/core/src/network/connection_monitor.rs index b83d104f61c..95ec9f0cf66 100644 --- a/consensus/core/src/network/connection_monitor.rs +++ b/consensus/core/src/network/connection_monitor.rs @@ -6,7 +6,7 @@ use std::{collections::HashMap, sync::Arc, time::Duration}; use anemo::{types::PeerEvent, PeerId}; use dashmap::DashMap; -use mysten_metrics::spawn_logged_monitored_task; +use iota_metrics::spawn_logged_monitored_task; use quinn_proto::ConnectionStats; use tokio::{ sync::oneshot::{Receiver, Sender}, diff --git a/consensus/core/src/network/tonic_network.rs b/consensus/core/src/network/tonic_network.rs index 4592dcc7911..d8eec229f58 100644 --- a/consensus/core/src/network/tonic_network.rs +++ b/consensus/core/src/network/tonic_network.rs @@ -13,7 +13,7 @@ use async_trait::async_trait; use bytes::Bytes; use cfg_if::cfg_if; use consensus_config::{AuthorityIndex, NetworkKeyPair}; -use mysten_network::{multiaddr::Protocol, Multiaddr}; +use iota_network_stack::{multiaddr::Protocol, Multiaddr}; use parking_lot::RwLock; use tokio::{ sync::oneshot::{self, Sender}, diff --git a/consensus/core/src/synchronizer.rs b/consensus/core/src/synchronizer.rs index 6769f956a87..e85ca5140c9 100644 --- a/consensus/core/src/synchronizer.rs +++ b/consensus/core/src/synchronizer.rs @@ -11,7 +11,7 @@ use std::{ use bytes::Bytes; use consensus_config::AuthorityIndex; use futures::{stream::FuturesUnordered, StreamExt}; -use mysten_metrics::{monitored_future, monitored_scope}; +use iota_metrics::{monitored_future, monitored_scope}; use parking_lot::Mutex; #[cfg(not(test))] use rand::{rngs::ThreadRng, seq::SliceRandom}; diff --git a/consensus/core/src/transaction.rs b/consensus/core/src/transaction.rs index 0248ccc3b20..30cfb6039ed 100644 --- a/consensus/core/src/transaction.rs +++ b/consensus/core/src/transaction.rs @@ -4,7 +4,7 @@ use std::sync::Arc; -use mysten_metrics::{metered_channel, metered_channel::channel_with_total}; +use iota_metrics::{metered_channel, metered_channel::channel_with_total}; use tap::tap::TapFallible; use thiserror::Error; use tokio::sync::oneshot; diff --git a/crates/iota-analytics-indexer/Cargo.toml b/crates/iota-analytics-indexer/Cargo.toml index 8467ea95a68..b61fdb838c1 100644 --- a/crates/iota-analytics-indexer/Cargo.toml +++ b/crates/iota-analytics-indexer/Cargo.toml @@ -25,6 +25,7 @@ iota-analytics-indexer-derive.workspace = true iota-config.workspace = true iota-indexer.workspace = true iota-json-rpc-types.workspace = true +iota-metrics.workspace = true iota-package-resolver.workspace = true iota-rest-api.workspace = true iota-storage.workspace = true @@ -32,7 +33,6 @@ iota-types.workspace = true move-binary-format.workspace = true move-bytecode-utils.workspace = true move-core-types.workspace = true -mysten-metrics.workspace = true num_enum.workspace = true object_store.workspace = true parquet = "52.1" diff --git a/crates/iota-analytics-indexer/src/main.rs b/crates/iota-analytics-indexer/src/main.rs index 30d0a000ff2..45a83a452e5 100644 --- a/crates/iota-analytics-indexer/src/main.rs +++ b/crates/iota-analytics-indexer/src/main.rs @@ -19,7 +19,7 @@ async fn main() -> Result<(), AnalyticsIndexerError> { let config = AnalyticsIndexerConfig::parse(); info!("Parsed config: {:#?}", config); - let registry_service = mysten_metrics::start_prometheus_server( + let registry_service = iota_metrics::start_prometheus_server( format!( "{}:{}", config.client_metric_host, config.client_metric_port @@ -28,7 +28,7 @@ async fn main() -> Result<(), AnalyticsIndexerError> { .unwrap(), ); let registry: Registry = registry_service.default_registry(); - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); let metrics = AnalyticsMetrics::new(®istry); let indexer_metrics = IndexerMetrics::new(®istry); diff --git a/crates/iota-authority-aggregation/Cargo.toml b/crates/iota-authority-aggregation/Cargo.toml index 24a1c03b412..027d927b377 100644 --- a/crates/iota-authority-aggregation/Cargo.toml +++ b/crates/iota-authority-aggregation/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] futures.workspace = true +iota-metrics.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true tokio.workspace = true tracing.workspace = true diff --git a/crates/iota-authority-aggregation/src/lib.rs b/crates/iota-authority-aggregation/src/lib.rs index d1478c2490c..8983bb2f23c 100644 --- a/crates/iota-authority-aggregation/src/lib.rs +++ b/crates/iota-authority-aggregation/src/lib.rs @@ -9,11 +9,11 @@ use std::{ }; use futures::{future::BoxFuture, stream::FuturesUnordered, Future, StreamExt}; +use iota_metrics::monitored_future; use iota_types::{ base_types::ConciseableName, committee::{CommitteeTrait, StakeUnit}, }; -use mysten_metrics::monitored_future; use tokio::time::timeout; use tracing::instrument::Instrument; diff --git a/crates/iota-aws-orchestrator/Cargo.toml b/crates/iota-aws-orchestrator/Cargo.toml index e0537a7f2bb..4596fdf27a1 100644 --- a/crates/iota-aws-orchestrator/Cargo.toml +++ b/crates/iota-aws-orchestrator/Cargo.toml @@ -29,9 +29,9 @@ thiserror.workspace = true tokio = { workspace = true, features = ["full"] } iota-config = { path = "../iota-config" } +iota-metrics.workspace = true iota-swarm-config = { path = "../iota-swarm-config" } iota-types = { path = "../iota-types" } -mysten-metrics.workspace = true narwhal-config.workspace = true [dev-dependencies] diff --git a/crates/iota-aws-orchestrator/src/protocol/iota.rs b/crates/iota-aws-orchestrator/src/protocol/iota.rs index 914a3adfdf7..8eaf3931f43 100644 --- a/crates/iota-aws-orchestrator/src/protocol/iota.rs +++ b/crates/iota-aws-orchestrator/src/protocol/iota.rs @@ -268,7 +268,7 @@ impl ProtocolMetrics for IotaProtocol { "{}:{}{}", instance.main_ip, config.metrics_address.port(), - mysten_metrics::METRICS_ROUTE + iota_metrics::METRICS_ROUTE ); (instance, path) }) @@ -286,7 +286,7 @@ impl ProtocolMetrics for IotaProtocol { "{}:{}{}", instance.main_ip, Self::CLIENT_METRICS_PORT, - mysten_metrics::METRICS_ROUTE + iota_metrics::METRICS_ROUTE ); (instance, path) }) diff --git a/crates/iota-aws-orchestrator/src/protocol/narwhal.rs b/crates/iota-aws-orchestrator/src/protocol/narwhal.rs index b6bb543fbaa..b0ab1733557 100644 --- a/crates/iota-aws-orchestrator/src/protocol/narwhal.rs +++ b/crates/iota-aws-orchestrator/src/protocol/narwhal.rs @@ -245,7 +245,7 @@ impl ProtocolMetrics for NarwhalProtocol { "{}:{}{}", instance.main_ip, PrometheusMetricsParameters::DEFAULT_PORT, - mysten_metrics::METRICS_ROUTE + iota_metrics::METRICS_ROUTE ); (instance, path) }) diff --git a/crates/iota-benchmark/Cargo.toml b/crates/iota-benchmark/Cargo.toml index 1dc4dcb353b..68e7f29e22b 100644 --- a/crates/iota-benchmark/Cargo.toml +++ b/crates/iota-benchmark/Cargo.toml @@ -41,8 +41,8 @@ tokio = { workspace = true, features = ["full"] } tokio-util.workspace = true tracing.workspace = true +iota-metrics.workspace = true move-core-types.workspace = true -mysten-metrics.workspace = true narwhal-node.workspace = true sysinfo = "0.31" test-cluster.workspace = true diff --git a/crates/iota-benchmark/src/bin/stress.rs b/crates/iota-benchmark/src/bin/stress.rs index 351f8326bc1..5ff9033c94d 100644 --- a/crates/iota-benchmark/src/bin/stress.rs +++ b/crates/iota-benchmark/src/bin/stress.rs @@ -70,13 +70,13 @@ async fn main() -> Result<()> { } let _guard = config.with_env().init(); - let registry_service = mysten_metrics::start_prometheus_server( + let registry_service = iota_metrics::start_prometheus_server( format!("{}:{}", opts.client_metric_host, opts.client_metric_port) .parse() .unwrap(), ); let registry: Registry = registry_service.default_registry(); - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); let barrier = Arc::new(Barrier::new(2)); let cloned_barrier = barrier.clone(); diff --git a/crates/iota-benchmark/src/embedded_reconfig_observer.rs b/crates/iota-benchmark/src/embedded_reconfig_observer.rs index b1ad903a11b..187d1608f96 100644 --- a/crates/iota-benchmark/src/embedded_reconfig_observer.rs +++ b/crates/iota-benchmark/src/embedded_reconfig_observer.rs @@ -11,7 +11,7 @@ use iota_core::{ authority_client::NetworkAuthorityClient, quorum_driver::{reconfig_observer::ReconfigObserver, QuorumDriver}, }; -use iota_network::default_mysten_network_config; +use iota_network::default_iota_network_stack_config; use iota_types::iota_system_state::IotaSystemStateTrait; use tracing::{error, info, trace}; @@ -50,7 +50,7 @@ impl EmbeddedReconfigObserver { { Err(err) => Err(err), Ok(committee_info) => { - let network_config = default_mysten_network_config(); + let network_config = default_iota_network_stack_config(); let new_epoch = committee_info.committee.epoch; if new_epoch <= cur_epoch { trace!( diff --git a/crates/iota-benchmark/src/lib.rs b/crates/iota-benchmark/src/lib.rs index 0dbcf9909c3..5db7ddf0892 100644 --- a/crates/iota-benchmark/src/lib.rs +++ b/crates/iota-benchmark/src/lib.rs @@ -28,6 +28,7 @@ use iota_json_rpc_types::{ IotaTransactionBlockEffects, IotaTransactionBlockEffectsAPI, IotaTransactionBlockResponseOptions, }; +use iota_metrics::GaugeGuard; use iota_network::{DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC}; use iota_sdk::{IotaClient, IotaClientBuilder}; use iota_types::{ @@ -49,7 +50,6 @@ use iota_types::{ programmable_transaction_builder::ProgrammableTransactionBuilder, transaction::{Argument, CallArg, CertifiedTransaction, ObjectArg, Transaction}, }; -use mysten_metrics::GaugeGuard; use prometheus::Registry; use rand::Rng; use roaring::RoaringBitmap; diff --git a/crates/mysten-common/Cargo.toml b/crates/iota-common/Cargo.toml similarity index 93% rename from crates/mysten-common/Cargo.toml rename to crates/iota-common/Cargo.toml index 1b255ca23a7..51a8eb35baa 100644 --- a/crates/mysten-common/Cargo.toml +++ b/crates/iota-common/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mysten-common" +name = "iota-common" version = "0.1.0" authors = ["IOTA Foundation "] edition = "2021" diff --git a/crates/mysten-common/src/lib.rs b/crates/iota-common/src/lib.rs similarity index 100% rename from crates/mysten-common/src/lib.rs rename to crates/iota-common/src/lib.rs diff --git a/crates/mysten-common/src/sync/async_once_cell.rs b/crates/iota-common/src/sync/async_once_cell.rs similarity index 100% rename from crates/mysten-common/src/sync/async_once_cell.rs rename to crates/iota-common/src/sync/async_once_cell.rs diff --git a/crates/mysten-common/src/sync/mod.rs b/crates/iota-common/src/sync/mod.rs similarity index 100% rename from crates/mysten-common/src/sync/mod.rs rename to crates/iota-common/src/sync/mod.rs diff --git a/crates/mysten-common/src/sync/notify_once.rs b/crates/iota-common/src/sync/notify_once.rs similarity index 100% rename from crates/mysten-common/src/sync/notify_once.rs rename to crates/iota-common/src/sync/notify_once.rs diff --git a/crates/mysten-common/src/sync/notify_read.rs b/crates/iota-common/src/sync/notify_read.rs similarity index 100% rename from crates/mysten-common/src/sync/notify_read.rs rename to crates/iota-common/src/sync/notify_read.rs diff --git a/crates/iota-core/Cargo.toml b/crates/iota-core/Cargo.toml index 10dab2127f4..91c77ac2714 100644 --- a/crates/iota-core/Cargo.toml +++ b/crates/iota-core/Cargo.toml @@ -52,13 +52,13 @@ anemo.workspace = true fastcrypto.workspace = true fastcrypto-tbls.workspace = true fastcrypto-zkp.workspace = true +iota-common.workspace = true +iota-network-stack.workspace = true move-binary-format.workspace = true move-bytecode-utils.workspace = true move-core-types.workspace = true move-package.workspace = true move-symbol-pool.workspace = true -mysten-common.workspace = true -mysten-network.workspace = true telemetry-subscribers.workspace = true typed-store.workspace = true typed-store-derive.workspace = true @@ -71,6 +71,7 @@ iota-framework.workspace = true iota-genesis-builder.workspace = true iota-json-rpc-types.workspace = true iota-macros.workspace = true +iota-metrics.workspace = true iota-move-build.workspace = true iota-network.workspace = true iota-protocol-config.workspace = true @@ -79,7 +80,6 @@ iota-storage.workspace = true iota-swarm-config.workspace = true iota-transaction-checks.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true narwhal-config.workspace = true narwhal-crypto.workspace = true narwhal-executor.workspace = true diff --git a/crates/iota-core/src/authority.rs b/crates/iota-core/src/authority.rs index 2f16e51346f..66e956fa661 100644 --- a/crates/iota-core/src/authority.rs +++ b/crates/iota-core/src/authority.rs @@ -42,6 +42,9 @@ use iota_json_rpc_types::{ IotaTransactionBlockEvents, TransactionFilter, }; use iota_macros::{fail_point, fail_point_async, fail_point_if}; +use iota_metrics::{ + monitored_scope, spawn_monitored_task, TX_TYPE_SHARED_OBJ_TX, TX_TYPE_SINGLE_WRITER_TX, +}; use iota_protocol_config::{ProtocolConfig, SupportedProtocolVersions}; use iota_storage::{ indexes::{CoinInfo, ObjectIndexChanges}, @@ -105,9 +108,6 @@ use iota_types::{ use itertools::Itertools; use move_binary_format::{binary_config::BinaryConfig, CompiledModule}; use move_core_types::{annotated_value::MoveStructLayout, language_storage::ModuleId}; -use mysten_metrics::{ - monitored_scope, spawn_monitored_task, TX_TYPE_SHARED_OBJ_TX, TX_TYPE_SINGLE_WRITER_TX, -}; use once_cell::sync::OnceCell; use parking_lot::Mutex; use prometheus::{ @@ -1440,7 +1440,7 @@ impl AuthorityState { _execution_guard: ExecutionLockReadGuard<'_>, epoch_store: &Arc, ) -> IotaResult { - let _scope: Option = + let _scope: Option = monitored_scope("Execution::commit_certificate"); let _metrics_guard = self.metrics.commit_certificate_latency.start_timer(); diff --git a/crates/iota-core/src/authority/authority_per_epoch_store.rs b/crates/iota-core/src/authority/authority_per_epoch_store.rs index a4f1ce6aacc..7acd38d5c7d 100644 --- a/crates/iota-core/src/authority/authority_per_epoch_store.rs +++ b/crates/iota-core/src/authority/authority_per_epoch_store.rs @@ -22,9 +22,11 @@ use futures::{ future::{join_all, select, Either}, FutureExt, }; +use iota_common::sync::{notify_once::NotifyOnce, notify_read::NotifyRead}; use iota_config::node::ExpensiveSafetyCheckConfig; use iota_execution::{self, Executor}; use iota_macros::fail_point; +use iota_metrics::monitored_scope; use iota_protocol_config::{Chain, ProtocolConfig, ProtocolVersion}; use iota_storage::mutex_table::{MutexGuard, MutexTable}; use iota_types::{ @@ -61,8 +63,6 @@ use iota_types::{ }; use itertools::{izip, Itertools}; use move_bytecode_utils::module_cache::SyncModuleCache; -use mysten_common::sync::{notify_once::NotifyOnce, notify_read::NotifyRead}; -use mysten_metrics::monitored_scope; use narwhal_executor::ExecutionIndices; use narwhal_types::{Round, TimestampMs}; use parking_lot::{Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard}; diff --git a/crates/iota-core/src/authority/authority_store.rs b/crates/iota-core/src/authority/authority_store.rs index 8e783874863..f3b765bc56c 100644 --- a/crates/iota-core/src/authority/authority_store.rs +++ b/crates/iota-core/src/authority/authority_store.rs @@ -7,6 +7,7 @@ use std::{cmp::Ordering, iter, mem, ops::Not, sync::Arc, thread}; use either::Either; use fastcrypto::hash::{HashFunction, MultisetHash, Sha3_256}; use futures::stream::FuturesUnordered; +use iota_common::sync::notify_read::NotifyRead; use iota_macros::fail_point_arg; use iota_storage::mutex_table::{MutexGuard, MutexTable, RwLockGuard, RwLockTable}; use iota_types::{ @@ -25,7 +26,6 @@ use iota_types::{ }; use itertools::izip; use move_core_types::resolver::ModuleResolver; -use mysten_common::sync::notify_read::NotifyRead; use serde::{Deserialize, Serialize}; use tokio::{ sync::{RwLockReadGuard, RwLockWriteGuard}, diff --git a/crates/iota-core/src/authority/authority_store_pruner.rs b/crates/iota-core/src/authority/authority_store_pruner.rs index 96d4d5c3004..c1928036143 100644 --- a/crates/iota-core/src/authority/authority_store_pruner.rs +++ b/crates/iota-core/src/authority/authority_store_pruner.rs @@ -12,6 +12,7 @@ use std::{ use anyhow::anyhow; use iota_archival::reader::ArchiveReaderBalancer; use iota_config::node::AuthorityStorePruningConfig; +use iota_metrics::{monitored_scope, spawn_monitored_task}; use iota_storage::mutex_table::RwLockTable; use iota_types::{ base_types::{ObjectID, SequenceNumber, VersionNumber}, @@ -20,7 +21,6 @@ use iota_types::{ messages_checkpoint::{CheckpointContents, CheckpointDigest, CheckpointSequenceNumber}, storage::ObjectKey, }; -use mysten_metrics::{monitored_scope, spawn_monitored_task}; use once_cell::sync::Lazy; use prometheus::{ register_int_counter_with_registry, register_int_gauge_with_registry, IntCounter, IntGauge, diff --git a/crates/iota-core/src/authority_aggregator.rs b/crates/iota-core/src/authority_aggregator.rs index e5092ab98b3..96b1a1baf75 100644 --- a/crates/iota-core/src/authority_aggregator.rs +++ b/crates/iota-core/src/authority_aggregator.rs @@ -15,9 +15,11 @@ use fastcrypto::traits::ToFromBytes; use futures::{future::BoxFuture, stream::FuturesUnordered, StreamExt}; use iota_authority_aggregation::{quorum_map_then_reduce_with_timeout, AsyncResult, ReduceOutput}; use iota_config::genesis::Genesis; +use iota_metrics::{histogram::Histogram, monitored_future, spawn_monitored_task, GaugeGuard}; use iota_network::{ - default_mysten_network_config, DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC, + default_iota_network_stack_config, DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_REQUEST_TIMEOUT_SEC, }; +use iota_network_stack::config::Config; use iota_swarm_config::network_config::NetworkConfig; use iota_types::{ base_types::*, @@ -42,8 +44,6 @@ use iota_types::{ quorum_driver_types::GroupedErrors, transaction::*, }; -use mysten_metrics::{histogram::Histogram, monitored_future, spawn_monitored_task, GaugeGuard}; -use mysten_network::config::Config; use prometheus::{ register_int_counter_vec_with_registry, register_int_counter_with_registry, register_int_gauge_with_registry, IntCounter, IntCounterVec, IntGauge, Registry, @@ -182,12 +182,12 @@ impl AuthAggMetrics { registry, ) .unwrap(), - remaining_tasks_when_reaching_cert_quorum: mysten_metrics::histogram::Histogram::new_in_registry( + remaining_tasks_when_reaching_cert_quorum: iota_metrics::histogram::Histogram::new_in_registry( "auth_agg_remaining_tasks_when_reaching_cert_quorum", "Number of remaining tasks when reaching certificate quorum", registry, ), - remaining_tasks_when_cert_broadcasting_post_quorum_timeout: mysten_metrics::histogram::Histogram::new_in_registry( + remaining_tasks_when_cert_broadcasting_post_quorum_timeout: iota_metrics::histogram::Histogram::new_in_registry( "auth_agg_remaining_tasks_when_cert_broadcasting_post_quorum_timeout", "Number of remaining tasks when post quorum certificate broadcasting times out", registry, @@ -687,7 +687,7 @@ impl AuthorityAggregator { auth_agg_metrics: Arc, validator_display_names: Arc>, ) -> anyhow::Result { - let net_config = default_mysten_network_config(); + let net_config = default_iota_network_stack_config(); let authority_clients = make_network_authority_clients_with_network_config(&committee, &net_config)?; Ok(Self::new_with_metrics( diff --git a/crates/iota-core/src/authority_client.rs b/crates/iota-core/src/authority_client.rs index ebd17050640..8b78553bb7c 100644 --- a/crates/iota-core/src/authority_client.rs +++ b/crates/iota-core/src/authority_client.rs @@ -8,6 +8,7 @@ use std::{collections::BTreeMap, time::Duration}; use anyhow::anyhow; use async_trait::async_trait; use iota_network::{api::ValidatorClient, tonic, tonic::transport::Channel}; +use iota_network_stack::config::Config; use iota_types::{ base_types::AuthorityName, committee::CommitteeWithNetworkMetadata, @@ -23,7 +24,6 @@ use iota_types::{ multiaddr::Multiaddr, transaction::*, }; -use mysten_network::config::Config; #[async_trait] pub trait AuthorityAPI { @@ -76,14 +76,14 @@ pub struct NetworkAuthorityClient { impl NetworkAuthorityClient { pub async fn connect(address: &Multiaddr) -> anyhow::Result { - let channel = mysten_network::client::connect(address) + let channel = iota_network_stack::client::connect(address) .await .map_err(|err| anyhow!(err.to_string()))?; Ok(Self::new(channel)) } pub fn connect_lazy(address: &Multiaddr) -> anyhow::Result { - let channel = mysten_network::client::connect_lazy(address) + let channel = iota_network_stack::client::connect_lazy(address) .map_err(|err| anyhow!(err.to_string()))?; Ok(Self::new(channel)) } @@ -213,7 +213,7 @@ pub fn make_authority_clients_with_timeout_config( connect_timeout: Duration, request_timeout: Duration, ) -> anyhow::Result> { - let mut network_config = mysten_network::config::Config::new(); + let mut network_config = iota_network_stack::config::Config::new(); network_config.connect_timeout = Some(connect_timeout); network_config.request_timeout = Some(request_timeout); make_network_authority_clients_with_network_config(committee, &network_config) diff --git a/crates/iota-core/src/authority_server.rs b/crates/iota-core/src/authority_server.rs index 785d3886996..106889cb105 100644 --- a/crates/iota-core/src/authority_server.rs +++ b/crates/iota-core/src/authority_server.rs @@ -7,6 +7,7 @@ use std::{io, sync::Arc}; use anyhow::Result; use async_trait::async_trait; +use iota_metrics::{histogram::Histogram as MystenHistogram, spawn_monitored_task}; use iota_network::{ api::{Validator, ValidatorServer}, tonic, @@ -29,7 +30,6 @@ use iota_types::{ multiaddr::Multiaddr, transaction::*, }; -use mysten_metrics::{histogram::Histogram as MystenHistogram, spawn_monitored_task}; use narwhal_worker::LazyNarwhalClient; use prometheus::{ register_int_counter_vec_with_registry, register_int_counter_with_registry, IntCounter, @@ -124,7 +124,7 @@ impl AuthorityServer { self, address: Multiaddr, ) -> Result { - let mut server = mysten_network::config::Config::new() + let mut server = iota_network_stack::config::Config::new() .server_builder() .add_service(ValidatorServer::new(ValidatorService { state: self.state, diff --git a/crates/iota-core/src/checkpoints/checkpoint_executor/metrics.rs b/crates/iota-core/src/checkpoints/checkpoint_executor/metrics.rs index 2dacfa5914c..0b326375e2f 100644 --- a/crates/iota-core/src/checkpoints/checkpoint_executor/metrics.rs +++ b/crates/iota-core/src/checkpoints/checkpoint_executor/metrics.rs @@ -4,7 +4,7 @@ use std::sync::Arc; -use mysten_metrics::histogram::Histogram; +use iota_metrics::histogram::Histogram; use prometheus::{ register_int_counter_with_registry, register_int_gauge_with_registry, IntCounter, IntGauge, Registry, diff --git a/crates/iota-core/src/checkpoints/checkpoint_executor/mod.rs b/crates/iota-core/src/checkpoints/checkpoint_executor/mod.rs index feebf06ec4e..6c4b9e3978d 100644 --- a/crates/iota-core/src/checkpoints/checkpoint_executor/mod.rs +++ b/crates/iota-core/src/checkpoints/checkpoint_executor/mod.rs @@ -31,6 +31,7 @@ use std::{ use futures::stream::FuturesOrdered; use iota_config::node::{CheckpointExecutorConfig, RunWithRange}; use iota_macros::{fail_point, fail_point_async}; +use iota_metrics::{spawn_monitored_task, MonitoredFutureExt}; use iota_types::{ base_types::{ExecutionDigests, TransactionDigest, TransactionEffectsDigest}, crypto::RandomnessRound, @@ -42,7 +43,6 @@ use iota_types::{ transaction::{TransactionDataAPI, TransactionKind, VerifiedTransaction}, }; use itertools::izip; -use mysten_metrics::{spawn_monitored_task, MonitoredFutureExt}; use prometheus::Registry; use tap::{TapFallible, TapOptional}; use tokio::{ diff --git a/crates/iota-core/src/checkpoints/metrics.rs b/crates/iota-core/src/checkpoints/metrics.rs index 77f1adc76dc..3eb6231462c 100644 --- a/crates/iota-core/src/checkpoints/metrics.rs +++ b/crates/iota-core/src/checkpoints/metrics.rs @@ -4,7 +4,7 @@ use std::sync::Arc; -use mysten_metrics::histogram::Histogram; +use iota_metrics::histogram::Histogram; use prometheus::{ register_int_counter_vec_with_registry, register_int_counter_with_registry, register_int_gauge_vec_with_registry, register_int_gauge_with_registry, IntCounter, diff --git a/crates/iota-core/src/checkpoints/mod.rs b/crates/iota-core/src/checkpoints/mod.rs index 7cd56915f4b..c0fd035b394 100644 --- a/crates/iota-core/src/checkpoints/mod.rs +++ b/crates/iota-core/src/checkpoints/mod.rs @@ -23,7 +23,8 @@ use futures::{ FutureExt, }; use iota_macros::fail_point; -use iota_network::default_mysten_network_config; +use iota_metrics::{monitored_scope, spawn_monitored_task, MonitoredFutureExt}; +use iota_network::default_iota_network_stack_config; use iota_protocol_config::ProtocolVersion; use iota_types::{ base_types::{AuthorityName, ConciseableName, EpochId, TransactionDigest}, @@ -50,7 +51,6 @@ use iota_types::{ transaction::{TransactionDataAPI, TransactionKey, TransactionKind}, }; use itertools::Itertools; -use mysten_metrics::{monitored_scope, spawn_monitored_task, MonitoredFutureExt}; use parking_lot::Mutex; use rand::{rngs::OsRng, seq::SliceRandom}; use serde::{Deserialize, Serialize}; @@ -1668,7 +1668,7 @@ async fn diagnose_split_brain( let committee = epoch_store .epoch_start_state() .get_iota_committee_with_network_metadata(); - let network_config = default_mysten_network_config(); + let network_config = default_iota_network_stack_config(); let network_clients = make_network_authority_clients_with_network_config(&committee, &network_config) .expect("Failed to make authority clients from committee {committee}"); diff --git a/crates/iota-core/src/consensus_adapter.rs b/crates/iota-core/src/consensus_adapter.rs index b417ccb8dd9..bbe832704b0 100644 --- a/crates/iota-core/src/consensus_adapter.rs +++ b/crates/iota-core/src/consensus_adapter.rs @@ -20,6 +20,7 @@ use futures::{ future::{select, Either}, pin_mut, FutureExt, }; +use iota_metrics::{spawn_monitored_task, GaugeGuard, GaugeGuardFutureExt}; use iota_protocol_config::ProtocolConfig; use iota_simulator::{anemo::PeerId, narwhal_network::connectivity::ConnectionStatus}; use iota_types::{ @@ -30,7 +31,6 @@ use iota_types::{ messages_consensus::{ConsensusTransaction, ConsensusTransactionKind}, }; use itertools::Itertools; -use mysten_metrics::{spawn_monitored_task, GaugeGuard, GaugeGuardFutureExt}; use narwhal_types::{TransactionProto, TransactionsClient}; use narwhal_worker::LazyNarwhalClient; use parking_lot::RwLockReadGuard; @@ -74,7 +74,7 @@ pub struct ConsensusAdapterMetrics { pub sequencing_certificate_success: IntCounterVec, pub sequencing_certificate_failures: IntCounterVec, pub sequencing_certificate_inflight: IntGaugeVec, - pub sequencing_acknowledge_latency: mysten_metrics::histogram::HistogramVec, + pub sequencing_acknowledge_latency: iota_metrics::histogram::HistogramVec, pub sequencing_certificate_latency: HistogramVec, pub sequencing_certificate_authority_position: Histogram, pub sequencing_certificate_positions_moved: Histogram, @@ -116,7 +116,7 @@ impl ConsensusAdapterMetrics { registry, ) .unwrap(), - sequencing_acknowledge_latency: mysten_metrics::histogram::HistogramVec::new_in_registry( + sequencing_acknowledge_latency: iota_metrics::histogram::HistogramVec::new_in_registry( "sequencing_acknowledge_latency", "The latency for acknowledgement from sequencing engine. The overall sequencing latency is measured by the sequencing_certificate_latency metric", &["retry", "tx_type"], diff --git a/crates/iota-core/src/consensus_handler.rs b/crates/iota-core/src/consensus_handler.rs index ceccd4a9b94..9a3427bd816 100644 --- a/crates/iota-core/src/consensus_handler.rs +++ b/crates/iota-core/src/consensus_handler.rs @@ -12,6 +12,7 @@ use std::{ use arc_swap::ArcSwap; use async_trait::async_trait; use iota_macros::{fail_point_async, fail_point_if}; +use iota_metrics::{monitored_scope, spawn_monitored_task}; use iota_types::{ authenticator_state::ActiveJwk, base_types::{AuthorityName, EpochId, TransactionDigest}, @@ -22,7 +23,6 @@ use iota_types::{ transaction::{SenderSignedData, VerifiedTransaction}, }; use lru::LruCache; -use mysten_metrics::{monitored_scope, spawn_monitored_task}; use narwhal_config::Committee; use narwhal_executor::{ExecutionIndices, ExecutionState}; use narwhal_types::ConsensusOutput; diff --git a/crates/iota-core/src/consensus_manager/mod.rs b/crates/iota-core/src/consensus_manager/mod.rs index 69ad040b94c..d6d76eb7e6a 100644 --- a/crates/iota-core/src/consensus_manager/mod.rs +++ b/crates/iota-core/src/consensus_manager/mod.rs @@ -8,9 +8,9 @@ use async_trait::async_trait; use enum_dispatch::enum_dispatch; use fastcrypto::traits::KeyPair as _; use iota_config::{ConsensusConfig, NodeConfig}; +use iota_metrics::RegistryService; use iota_protocol_config::ProtocolVersion; use iota_types::committee::EpochId; -use mysten_metrics::RegistryService; use prometheus::{register_int_gauge_with_registry, IntGauge, Registry}; use tokio::sync::{Mutex, MutexGuard}; diff --git a/crates/iota-core/src/consensus_manager/mysticeti_manager.rs b/crates/iota-core/src/consensus_manager/mysticeti_manager.rs index 5fadb74f180..b3600e2618e 100644 --- a/crates/iota-core/src/consensus_manager/mysticeti_manager.rs +++ b/crates/iota-core/src/consensus_manager/mysticeti_manager.rs @@ -10,11 +10,11 @@ use consensus_config::{Committee, NetworkKeyPair, Parameters, ProtocolKeyPair}; use consensus_core::{CommitConsumer, CommitIndex, ConsensusAuthority, NetworkType, Round}; use fastcrypto::ed25519; use iota_config::NodeConfig; +use iota_metrics::{RegistryID, RegistryService}; use iota_types::{ committee::EpochId, iota_system_state::epoch_start_iota_system_state::EpochStartSystemStateTrait, }; -use mysten_metrics::{RegistryID, RegistryService}; use narwhal_executor::ExecutionState; use prometheus::Registry; use tokio::sync::{mpsc::unbounded_channel, Mutex}; diff --git a/crates/iota-core/src/consensus_manager/narwhal_manager.rs b/crates/iota-core/src/consensus_manager/narwhal_manager.rs index 21907089930..448bcd0148c 100644 --- a/crates/iota-core/src/consensus_manager/narwhal_manager.rs +++ b/crates/iota-core/src/consensus_manager/narwhal_manager.rs @@ -7,12 +7,12 @@ use std::{path::PathBuf, sync::Arc}; use async_trait::async_trait; use fastcrypto::traits::KeyPair; use iota_config::NodeConfig; +use iota_metrics::RegistryService; use iota_types::{ committee::EpochId, crypto::{AuthorityKeyPair, NetworkKeyPair}, iota_system_state::epoch_start_iota_system_state::EpochStartSystemStateTrait, }; -use mysten_metrics::RegistryService; use narwhal_config::{Parameters, WorkerId}; use narwhal_network::client::NetworkClient; use narwhal_node::{ diff --git a/crates/iota-core/src/consensus_validator.rs b/crates/iota-core/src/consensus_validator.rs index 791b33b7852..9338fb43f62 100644 --- a/crates/iota-core/src/consensus_validator.rs +++ b/crates/iota-core/src/consensus_validator.rs @@ -6,8 +6,8 @@ use std::sync::Arc; use consensus_core::{TransactionVerifier, ValidationError}; use eyre::WrapErr; +use iota_metrics::monitored_scope; use iota_types::messages_consensus::{ConsensusTransaction, ConsensusTransactionKind}; -use mysten_metrics::monitored_scope; use narwhal_types::BatchAPI; use narwhal_worker::TransactionValidator; use prometheus::{register_int_counter_with_registry, IntCounter, Registry}; diff --git a/crates/iota-core/src/epoch/data_removal.rs b/crates/iota-core/src/epoch/data_removal.rs index c2ea58ca1eb..91135efe9a3 100644 --- a/crates/iota-core/src/epoch/data_removal.rs +++ b/crates/iota-core/src/epoch/data_removal.rs @@ -8,7 +8,7 @@ pub mod epoch_data_tests; use std::{fs, path::PathBuf}; -use mysten_metrics::spawn_monitored_task; +use iota_metrics::spawn_monitored_task; use narwhal_config::Epoch; use tokio::sync::mpsc; diff --git a/crates/iota-core/src/execution_cache/passthrough_cache.rs b/crates/iota-core/src/execution_cache/passthrough_cache.rs index a3a362f3fac..fa4c44a9392 100644 --- a/crates/iota-core/src/execution_cache/passthrough_cache.rs +++ b/crates/iota-core/src/execution_cache/passthrough_cache.rs @@ -9,6 +9,7 @@ use futures::{ future::{join_all, BoxFuture}, FutureExt, }; +use iota_common::sync::notify_read::NotifyRead; use iota_config::node::AuthorityStorePruningConfig; use iota_protocol_config::ProtocolVersion; use iota_storage::package_object_cache::PackageObjectCache; @@ -25,7 +26,6 @@ use iota_types::{ storage::{MarkerValue, ObjectKey, ObjectOrTombstone, ObjectStore, PackageObject}, transaction::{VerifiedSignedTransaction, VerifiedTransaction}, }; -use mysten_common::sync::notify_read::NotifyRead; use prometheus::Registry; use tap::TapFallible; use tracing::instrument; diff --git a/crates/iota-core/src/execution_cache/writeback_cache.rs b/crates/iota-core/src/execution_cache/writeback_cache.rs index d30309785ae..17b567c1e80 100644 --- a/crates/iota-core/src/execution_cache/writeback_cache.rs +++ b/crates/iota-core/src/execution_cache/writeback_cache.rs @@ -55,6 +55,7 @@ use futures::{ future::{join_all, BoxFuture}, FutureExt, }; +use iota_common::sync::notify_read::NotifyRead; use iota_config::node::AuthorityStorePruningConfig; use iota_macros::fail_point_async; use iota_protocol_config::ProtocolVersion; @@ -72,7 +73,6 @@ use iota_types::{ transaction::{VerifiedSignedTransaction, VerifiedTransaction}, }; use moka::sync::Cache as MokaCache; -use mysten_common::sync::notify_read::NotifyRead; use parking_lot::Mutex; use prometheus::Registry; use tracing::{info, instrument}; diff --git a/crates/iota-core/src/execution_driver.rs b/crates/iota-core/src/execution_driver.rs index afc2bc90ccb..08ceb752a66 100644 --- a/crates/iota-core/src/execution_driver.rs +++ b/crates/iota-core/src/execution_driver.rs @@ -8,7 +8,7 @@ use std::{ }; use iota_macros::fail_point_async; -use mysten_metrics::{monitored_scope, spawn_monitored_task}; +use iota_metrics::{monitored_scope, spawn_monitored_task}; use rand::{ rngs::{OsRng, StdRng}, Rng, SeedableRng, diff --git a/crates/iota-core/src/post_consensus_tx_reorder.rs b/crates/iota-core/src/post_consensus_tx_reorder.rs index 6710775a882..a6bd86b18ed 100644 --- a/crates/iota-core/src/post_consensus_tx_reorder.rs +++ b/crates/iota-core/src/post_consensus_tx_reorder.rs @@ -2,9 +2,9 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use iota_metrics::monitored_scope; use iota_protocol_config::ConsensusTransactionOrdering; use iota_types::messages_consensus::{ConsensusTransaction, ConsensusTransactionKind}; -use mysten_metrics::monitored_scope; use crate::consensus_handler::{ SequencedConsensusTransactionKind, VerifiedSequencedConsensusTransaction, diff --git a/crates/iota-core/src/quorum_driver/metrics.rs b/crates/iota-core/src/quorum_driver/metrics.rs index c0ce4e98fa4..be739d9a77a 100644 --- a/crates/iota-core/src/quorum_driver/metrics.rs +++ b/crates/iota-core/src/quorum_driver/metrics.rs @@ -3,7 +3,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use mysten_metrics::histogram::Histogram; +use iota_metrics::histogram::Histogram; use prometheus::{ register_histogram_vec_with_registry, register_int_counter_vec_with_registry, register_int_counter_with_registry, register_int_gauge_with_registry, HistogramVec, IntCounter, diff --git a/crates/iota-core/src/quorum_driver/mod.rs b/crates/iota-core/src/quorum_driver/mod.rs index 7392b4c4f41..baf7d18f8e2 100644 --- a/crates/iota-core/src/quorum_driver/mod.rs +++ b/crates/iota-core/src/quorum_driver/mod.rs @@ -15,6 +15,10 @@ use std::{ }; use arc_swap::ArcSwap; +use iota_common::sync::notify_read::{NotifyRead, Registration}; +use iota_metrics::{ + spawn_monitored_task, GaugeGuard, TX_TYPE_SHARED_OBJ_TX, TX_TYPE_SINGLE_WRITER_TX, +}; use iota_types::{ base_types::{AuthorityName, ObjectRef, TransactionDigest}, committee::{Committee, EpochId, StakeUnit}, @@ -25,10 +29,6 @@ use iota_types::{ }, transaction::{CertifiedTransaction, Transaction}, }; -use mysten_common::sync::notify_read::{NotifyRead, Registration}; -use mysten_metrics::{ - spawn_monitored_task, GaugeGuard, TX_TYPE_SHARED_OBJ_TX, TX_TYPE_SINGLE_WRITER_TX, -}; use tap::TapFallible; use tokio::{ sync::{ diff --git a/crates/iota-core/src/quorum_driver/tests.rs b/crates/iota-core/src/quorum_driver/tests.rs index 5c1e337f3b1..709158103b0 100644 --- a/crates/iota-core/src/quorum_driver/tests.rs +++ b/crates/iota-core/src/quorum_driver/tests.rs @@ -4,6 +4,7 @@ use std::{sync::Arc, time::Duration}; +use iota_common::sync::notify_read::{NotifyRead, Registration}; use iota_types::{ base_types::{IotaAddress, TransactionDigest}, crypto::{deterministic_random_account_key, get_key_pair, AccountKeyPair}, @@ -12,7 +13,6 @@ use iota_types::{ quorum_driver_types::{QuorumDriverError, QuorumDriverResponse, QuorumDriverResult}, transaction::Transaction, }; -use mysten_common::sync::notify_read::{NotifyRead, Registration}; use tokio::time::timeout; use crate::{ diff --git a/crates/iota-core/src/safe_client.rs b/crates/iota-core/src/safe_client.rs index b940f70206c..e59f31bb3ff 100644 --- a/crates/iota-core/src/safe_client.rs +++ b/crates/iota-core/src/safe_client.rs @@ -5,6 +5,7 @@ use std::sync::Arc; +use iota_metrics::histogram::{Histogram, HistogramVec}; use iota_types::{ base_types::*, committee::*, @@ -23,7 +24,6 @@ use iota_types::{ messages_safe_client::PlainTransactionInfoResponse, transaction::*, }; -use mysten_metrics::histogram::{Histogram, HistogramVec}; use prometheus::{ core::GenericCounter, register_int_counter_vec_with_registry, IntCounterVec, Registry, }; diff --git a/crates/iota-core/src/scoring_decision.rs b/crates/iota-core/src/scoring_decision.rs index c852f664cde..fb27c9c66f0 100644 --- a/crates/iota-core/src/scoring_decision.rs +++ b/crates/iota-core/src/scoring_decision.rs @@ -95,7 +95,7 @@ mod tests { use arc_swap::ArcSwap; use fastcrypto::traits::{InsecureDefault, KeyPair as _}; - use mysten_network::Multiaddr; + use iota_network_stack::Multiaddr; use narwhal_config::{Committee, CommitteeBuilder}; use narwhal_crypto::{KeyPair, NetworkPublicKey}; use narwhal_types::ReputationScores; diff --git a/crates/iota-core/src/signature_verifier.rs b/crates/iota-core/src/signature_verifier.rs index e4098d8cc68..45e2f81a79f 100644 --- a/crates/iota-core/src/signature_verifier.rs +++ b/crates/iota-core/src/signature_verifier.rs @@ -11,6 +11,7 @@ use fastcrypto_zkp::bn254::{ }; use futures::pin_mut; use im::hashmap::HashMap as ImHashMap; +use iota_metrics::monitored_scope; use iota_types::{ committee::Committee, crypto::{AuthoritySignInfoTrait, VerificationObligation}, @@ -23,7 +24,6 @@ use iota_types::{ }; use itertools::izip; use lru::LruCache; -use mysten_metrics::monitored_scope; use parking_lot::{Mutex, MutexGuard, RwLock}; use prometheus::{register_int_counter_with_registry, IntCounter, Registry}; use shared_crypto::intent::Intent; diff --git a/crates/iota-core/src/state_accumulator.rs b/crates/iota-core/src/state_accumulator.rs index adfb7dbbd1e..2709cbc5702 100644 --- a/crates/iota-core/src/state_accumulator.rs +++ b/crates/iota-core/src/state_accumulator.rs @@ -8,6 +8,7 @@ use std::{ }; use fastcrypto::hash::MultisetHash; +use iota_metrics::monitored_scope; use iota_protocol_config::ProtocolConfig; use iota_types::{ accumulator::Accumulator, @@ -21,7 +22,6 @@ use iota_types::{ storage::{ObjectKey, ObjectStore}, }; use itertools::Itertools; -use mysten_metrics::monitored_scope; use serde::Serialize; use tracing::debug; diff --git a/crates/iota-core/src/streamer.rs b/crates/iota-core/src/streamer.rs index eb635f90900..957f02abbe3 100644 --- a/crates/iota-core/src/streamer.rs +++ b/crates/iota-core/src/streamer.rs @@ -6,8 +6,8 @@ use std::{collections::BTreeMap, fmt::Debug, sync::Arc}; use futures::Stream; use iota_json_rpc_types::Filter; +use iota_metrics::{metered_channel::Sender, spawn_monitored_task}; use iota_types::{base_types::ObjectID, error::IotaError}; -use mysten_metrics::{metered_channel::Sender, spawn_monitored_task}; use parking_lot::RwLock; use prometheus::Registry; use tokio::sync::mpsc; @@ -38,19 +38,19 @@ where metrics_label: &'static str, ) -> Self { let channel_label = format!("streamer_{}", metrics_label); - let gauge = if let Some(metrics) = mysten_metrics::get_metrics() { + let gauge = if let Some(metrics) = iota_metrics::get_metrics() { metrics.channels.with_label_values(&[&channel_label]) } else { // We call init_metrics very early when starting a node. Therefore when this // happens, it's probably in a test. - mysten_metrics::init_metrics(&Registry::default()); - mysten_metrics::get_metrics() + iota_metrics::init_metrics(&Registry::default()); + iota_metrics::get_metrics() .unwrap() .channels .with_label_values(&[&channel_label]) }; - let (tx, rx) = mysten_metrics::metered_channel::channel(buffer, &gauge); + let (tx, rx) = iota_metrics::metered_channel::channel(buffer, &gauge); let streamer = Self { streamer_queue: tx, subscribers: Default::default(), diff --git a/crates/iota-core/src/test_authority_clients.rs b/crates/iota-core/src/test_authority_clients.rs index d87bf29ec69..ad877971c8c 100644 --- a/crates/iota-core/src/test_authority_clients.rs +++ b/crates/iota-core/src/test_authority_clients.rs @@ -10,6 +10,7 @@ use std::{ use async_trait::async_trait; use iota_config::genesis::Genesis; +use iota_metrics::spawn_monitored_task; use iota_types::{ crypto::AuthorityKeyPair, effects::{TransactionEffectsAPI, TransactionEvents}, @@ -24,7 +25,6 @@ use iota_types::{ }, transaction::{CertifiedTransaction, Transaction, VerifiedTransaction}, }; -use mysten_metrics::spawn_monitored_task; use crate::{ authority::{test_authority_builder::TestAuthorityBuilder, AuthorityState}, diff --git a/crates/iota-core/src/transaction_manager.rs b/crates/iota-core/src/transaction_manager.rs index b8fc4a6963b..cc654832789 100644 --- a/crates/iota-core/src/transaction_manager.rs +++ b/crates/iota-core/src/transaction_manager.rs @@ -10,6 +10,7 @@ use std::{ }; use indexmap::IndexMap; +use iota_metrics::monitored_scope; use iota_types::{ base_types::{ObjectID, SequenceNumber, TransactionDigest}, committee::EpochId, @@ -22,7 +23,6 @@ use iota_types::{ transaction::{SenderSignedData, TransactionDataAPI, VerifiedCertificate}, }; use lru::LruCache; -use mysten_metrics::monitored_scope; use parking_lot::RwLock; use tap::TapOptional; use tokio::{sync::mpsc::UnboundedSender, time::Instant}; diff --git a/crates/iota-core/src/transaction_orchestrator.rs b/crates/iota-core/src/transaction_orchestrator.rs index 275f61ead7f..0bde1cfca5a 100644 --- a/crates/iota-core/src/transaction_orchestrator.rs +++ b/crates/iota-core/src/transaction_orchestrator.rs @@ -8,6 +8,12 @@ use futures::{ future::{select, Either, Future}, FutureExt, }; +use iota_common::sync::notify_read::NotifyRead; +use iota_metrics::{ + histogram::{Histogram, HistogramVec}, + spawn_logged_monitored_task, spawn_monitored_task, TX_TYPE_SHARED_OBJ_TX, + TX_TYPE_SINGLE_WRITER_TX, +}; use iota_storage::write_path_pending_tx_log::WritePathPendingTransactionLog; use iota_types::{ base_types::TransactionDigest, @@ -22,12 +28,6 @@ use iota_types::{ }, transaction::VerifiedTransaction, }; -use mysten_common::sync::notify_read::NotifyRead; -use mysten_metrics::{ - histogram::{Histogram, HistogramVec}, - spawn_logged_monitored_task, spawn_monitored_task, TX_TYPE_SHARED_OBJ_TX, - TX_TYPE_SINGLE_WRITER_TX, -}; use prometheus::{ core::{AtomicI64, AtomicU64, GenericCounter, GenericGauge}, register_int_counter_vec_with_registry, register_int_counter_with_registry, diff --git a/crates/iota-core/src/unit_tests/consensus_tests.rs b/crates/iota-core/src/unit_tests/consensus_tests.rs index a0ba95edc28..7bcc22ca9d9 100644 --- a/crates/iota-core/src/unit_tests/consensus_tests.rs +++ b/crates/iota-core/src/unit_tests/consensus_tests.rs @@ -175,7 +175,7 @@ impl ConsensusMockServer { pub fn spawn(address: Multiaddr) -> Receiver { let (sender, receiver) = channel(1); tokio::spawn(async move { - let config = mysten_network::config::Config::new(); + let config = iota_network_stack::config::Config::new(); let mock = Self { sender }; config .server_builder() diff --git a/crates/iota-core/src/unit_tests/mysticeti_manager_tests.rs b/crates/iota-core/src/unit_tests/mysticeti_manager_tests.rs index f1b69ed31c0..47d98f20686 100644 --- a/crates/iota-core/src/unit_tests/mysticeti_manager_tests.rs +++ b/crates/iota-core/src/unit_tests/mysticeti_manager_tests.rs @@ -5,8 +5,8 @@ use std::{sync::Arc, time::Duration}; use fastcrypto::traits::KeyPair; +use iota_metrics::RegistryService; use iota_swarm_config::network_config_builder::ConfigBuilder; -use mysten_metrics::RegistryService; use prometheus::Registry; use tokio::time::sleep; diff --git a/crates/iota-core/src/unit_tests/narwhal_manager_tests.rs b/crates/iota-core/src/unit_tests/narwhal_manager_tests.rs index adcd55c38f3..ee640479b66 100644 --- a/crates/iota-core/src/unit_tests/narwhal_manager_tests.rs +++ b/crates/iota-core/src/unit_tests/narwhal_manager_tests.rs @@ -6,6 +6,7 @@ use std::{sync::Arc, time::Duration}; use bytes::Bytes; use fastcrypto::{bls12381, traits::KeyPair}; +use iota_metrics::RegistryService; use iota_swarm_config::network_config_builder::ConfigBuilder; use iota_types::{ iota_system_state::{ @@ -13,7 +14,6 @@ use iota_types::{ }, messages_checkpoint::{CertifiedCheckpointSummary, CheckpointContents, CheckpointSummary}, }; -use mysten_metrics::RegistryService; use narwhal_config::{Epoch, WorkerCache}; use narwhal_types::{TransactionProto, TransactionsClient}; use prometheus::Registry; @@ -44,7 +44,7 @@ async fn send_transactions( .worker(name, /* id */ &0) .expect("Our key or worker id is not in the worker cache") .transactions; - let config = mysten_network::config::Config::new(); + let config = iota_network_stack::config::Config::new(); let channel = config.connect_lazy(&target).unwrap(); let mut client = TransactionsClient::new(channel); // Make a transaction to submit forever. diff --git a/crates/iota-core/src/unit_tests/transaction_tests.rs b/crates/iota-core/src/unit_tests/transaction_tests.rs index 996159d5614..e27fa2a66e3 100644 --- a/crates/iota-core/src/unit_tests/transaction_tests.rs +++ b/crates/iota-core/src/unit_tests/transaction_tests.rs @@ -7,6 +7,7 @@ use std::ops::Deref; use fastcrypto::{ed25519::Ed25519KeyPair, traits::KeyPair}; use fastcrypto_zkp::bn254::zk_login::{parse_jwks, OIDCProvider, ZkLoginInputs}; use iota_macros::sim_test; +use iota_network_stack::Multiaddr; use iota_types::{ authenticator_state::ActiveJwk, base_types::dbg_addr, @@ -22,7 +23,6 @@ use iota_types::{ zk_login_authenticator::ZkLoginAuthenticator, zk_login_util::DEFAULT_JWK_BYTES, }; -use mysten_network::Multiaddr; use rand::{rngs::StdRng, SeedableRng}; use shared_crypto::intent::{Intent, IntentMessage}; diff --git a/crates/iota-data-ingestion-core/Cargo.toml b/crates/iota-data-ingestion-core/Cargo.toml index faebd09a3c4..ea275b2a825 100644 --- a/crates/iota-data-ingestion-core/Cargo.toml +++ b/crates/iota-data-ingestion-core/Cargo.toml @@ -11,9 +11,9 @@ anyhow.workspace = true async-trait.workspace = true backoff.workspace = true futures.workspace = true +iota-metrics.workspace = true iota-storage.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true notify.workspace = true object_store.workspace = true prometheus.workspace = true diff --git a/crates/iota-data-ingestion-core/src/executor.rs b/crates/iota-data-ingestion-core/src/executor.rs index 98f8850e0c3..707ca6c833f 100644 --- a/crates/iota-data-ingestion-core/src/executor.rs +++ b/crates/iota-data-ingestion-core/src/executor.rs @@ -6,10 +6,10 @@ use std::{path::PathBuf, pin::Pin}; use anyhow::Result; use futures::Future; +use iota_metrics::spawn_monitored_task; use iota_types::{ full_checkpoint_content::CheckpointData, messages_checkpoint::CheckpointSequenceNumber, }; -use mysten_metrics::spawn_monitored_task; use prometheus::Registry; use tokio::sync::{mpsc, oneshot}; diff --git a/crates/iota-data-ingestion-core/src/reader.rs b/crates/iota-data-ingestion-core/src/reader.rs index 5f0411252e0..79c400cf9f8 100644 --- a/crates/iota-data-ingestion-core/src/reader.rs +++ b/crates/iota-data-ingestion-core/src/reader.rs @@ -7,11 +7,11 @@ use std::{ffi::OsString, fs, path::PathBuf, time::Duration}; use anyhow::Result; use backoff::backoff::Backoff; use futures::StreamExt; +use iota_metrics::spawn_monitored_task; use iota_storage::blob::Blob; use iota_types::{ full_checkpoint_content::CheckpointData, messages_checkpoint::CheckpointSequenceNumber, }; -use mysten_metrics::spawn_monitored_task; use notify::{RecursiveMode, Watcher}; use object_store::{path::Path, ObjectStore}; use tap::pipe::Pipe; diff --git a/crates/iota-data-ingestion-core/src/worker_pool.rs b/crates/iota-data-ingestion-core/src/worker_pool.rs index 2d2229b9721..36a123a2d44 100644 --- a/crates/iota-data-ingestion-core/src/worker_pool.rs +++ b/crates/iota-data-ingestion-core/src/worker_pool.rs @@ -8,10 +8,10 @@ use std::{ time::Instant, }; +use iota_metrics::spawn_monitored_task; use iota_types::{ full_checkpoint_content::CheckpointData, messages_checkpoint::CheckpointSequenceNumber, }; -use mysten_metrics::spawn_monitored_task; use tokio::sync::{mpsc, oneshot}; use tracing::info; diff --git a/crates/iota-data-ingestion/Cargo.toml b/crates/iota-data-ingestion/Cargo.toml index e0e17f57b25..8ba62602513 100644 --- a/crates/iota-data-ingestion/Cargo.toml +++ b/crates/iota-data-ingestion/Cargo.toml @@ -20,9 +20,9 @@ bytes.workspace = true futures.workspace = true iota-archival.workspace = true iota-data-ingestion-core.workspace = true +iota-metrics.workspace = true iota-storage.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true notify.workspace = true object_store.workspace = true prometheus.workspace = true diff --git a/crates/iota-data-ingestion/src/main.rs b/crates/iota-data-ingestion/src/main.rs index 88f087fcacf..1d87bd36c0b 100644 --- a/crates/iota-data-ingestion/src/main.rs +++ b/crates/iota-data-ingestion/src/main.rs @@ -99,11 +99,11 @@ async fn main() -> Result<()> { let _guard = telemetry_subscribers::TelemetryConfig::new() .with_env() .init(); - let registry_service = mysten_metrics::start_prometheus_server( + let registry_service = iota_metrics::start_prometheus_server( format!("{}:{}", config.metrics_host, config.metrics_port).parse()?, ); let registry: Registry = registry_service.default_registry(); - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); let metrics = DataIngestionMetrics::new(®istry); let progress_store = DynamoDBProgressStore::new( diff --git a/crates/iota-e2e-tests/Cargo.toml b/crates/iota-e2e-tests/Cargo.toml index c40fe6a2c03..ad04bc1b3ab 100644 --- a/crates/iota-e2e-tests/Cargo.toml +++ b/crates/iota-e2e-tests/Cargo.toml @@ -44,6 +44,7 @@ iota-json-rpc-api.workspace = true iota-json-rpc-types.workspace = true iota-keys.workspace = true iota-macros.workspace = true +iota-metrics.workspace = true iota-move-build.workspace = true iota-node.workspace = true iota-protocol-config.workspace = true @@ -55,5 +56,4 @@ iota-swarm-config.workspace = true iota-test-transaction-builder.workspace = true iota-tool.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true shared-crypto.workspace = true diff --git a/crates/iota-faucet/Cargo.toml b/crates/iota-faucet/Cargo.toml index d6bbb4dcbb4..8fc58b533ea 100644 --- a/crates/iota-faucet/Cargo.toml +++ b/crates/iota-faucet/Cargo.toml @@ -33,9 +33,9 @@ async-recursion.workspace = true iota-config.workspace = true iota-json-rpc-types.workspace = true iota-keys.workspace = true +iota-metrics.workspace = true iota-sdk.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true shared-crypto.workspace = true telemetry-subscribers.workspace = true typed-store.workspace = true diff --git a/crates/iota-faucet/src/faucet/simple_faucet.rs b/crates/iota-faucet/src/faucet/simple_faucet.rs index b4ae76ffc15..1daa156803e 100644 --- a/crates/iota-faucet/src/faucet/simple_faucet.rs +++ b/crates/iota-faucet/src/faucet/simple_faucet.rs @@ -18,6 +18,7 @@ use iota_json_rpc_types::{ IotaTransactionBlockResponseOptions, OwnedObjectRef, }; use iota_keys::keystore::AccountKeystore; +use iota_metrics::spawn_monitored_task; use iota_sdk::wallet_context::WalletContext; use iota_types::{ base_types::{IotaAddress, ObjectID, TransactionDigest}, @@ -27,7 +28,6 @@ use iota_types::{ quorum_driver_types::ExecuteTransactionRequestType, transaction::{Transaction, TransactionData}, }; -use mysten_metrics::spawn_monitored_task; use prometheus::Registry; use shared_crypto::intent::Intent; use tap::tap::TapFallible; diff --git a/crates/iota-faucet/src/main.rs b/crates/iota-faucet/src/main.rs index 60fcf4af319..2dd30f74e6b 100644 --- a/crates/iota-faucet/src/main.rs +++ b/crates/iota-faucet/src/main.rs @@ -25,8 +25,8 @@ use iota_faucet::{ BatchFaucetResponse, BatchStatusFaucetResponse, Faucet, FaucetConfig, FaucetError, FaucetRequest, FaucetResponse, RequestMetricsLayer, SimpleFaucet, }; +use iota_metrics::spawn_monitored_task; use iota_sdk::wallet_context::WalletContext; -use mysten_metrics::spawn_monitored_task; use tower::{limit::RateLimitLayer, ServiceBuilder}; use tower_http::cors::{Any, CorsLayer}; use tracing::{info, warn}; @@ -70,7 +70,7 @@ async fn main() -> Result<(), anyhow::Error> { let prom_binding = PROM_PORT_ADDR.parse().unwrap(); info!("Starting Prometheus HTTP endpoint at {}", prom_binding); - let registry_service = mysten_metrics::start_prometheus_server(prom_binding); + let registry_service = iota_metrics::start_prometheus_server(prom_binding); let prometheus_registry = registry_service.default_registry(); let app_state = Arc::new(AppState { faucet: SimpleFaucet::new( diff --git a/crates/iota-graphql-rpc/Cargo.toml b/crates/iota-graphql-rpc/Cargo.toml index dc0c756a33f..9281246e9af 100644 --- a/crates/iota-graphql-rpc/Cargo.toml +++ b/crates/iota-graphql-rpc/Cargo.toml @@ -29,6 +29,8 @@ http-body-util.workspace = true hyper.workspace = true hyper-util = { workspace = true, features = ["http2", "server", "tokio"] } im.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true iota-sdk.workspace = true iota-types.workspace = true lru.workspace = true @@ -37,8 +39,6 @@ move-binary-format.workspace = true move-core-types.workspace = true move-disassembler.workspace = true move-ir-types.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true once_cell.workspace = true prometheus.workspace = true rand.workspace = true # todo: cleanup test only deps diff --git a/crates/iota-graphql-rpc/src/server/builder.rs b/crates/iota-graphql-rpc/src/server/builder.rs index 7d8a131ee4b..b33e39fcff6 100644 --- a/crates/iota-graphql-rpc/src/server/builder.rs +++ b/crates/iota-graphql-rpc/src/server/builder.rs @@ -31,10 +31,10 @@ use axum::{ use axum_extra::headers::Header as _; use http::{HeaderValue, Method, Request}; use iota_graphql_rpc_headers::{LIMITS_HEADER, VERSION_HEADER}; +use iota_metrics::spawn_monitored_task; +use iota_network_stack::callback::{CallbackLayer, MakeCallbackHandler, ResponseHandler}; use iota_package_resolver::{PackageStoreWithLruCache, Resolver}; use iota_sdk::IotaClientBuilder; -use mysten_metrics::spawn_monitored_task; -use mysten_network::callback::{CallbackLayer, MakeCallbackHandler, ResponseHandler}; use tokio::{join, net::TcpListener, sync::OnceCell}; use tokio_util::sync::CancellationToken; use tower::{Layer, Service}; @@ -358,11 +358,11 @@ impl ServerBuilder { )) })?; - let registry_service = mysten_metrics::start_prometheus_server(prom_addr); + let registry_service = iota_metrics::start_prometheus_server(prom_addr); info!("Starting Prometheus HTTP endpoint at {}", prom_addr); let registry = registry_service.default_registry(); registry - .register(mysten_metrics::uptime_metric( + .register(iota_metrics::uptime_metric( "graphql", version.full, "unknown", @@ -673,7 +673,7 @@ pub mod tests { fn metrics() -> Metrics { let binding_address: SocketAddr = "0.0.0.0:9185".parse().unwrap(); - let registry = mysten_metrics::start_prometheus_server(binding_address).default_registry(); + let registry = iota_metrics::start_prometheus_server(binding_address).default_registry(); Metrics::new(®istry) } diff --git a/crates/iota-graphql-rpc/src/server/version.rs b/crates/iota-graphql-rpc/src/server/version.rs index 3e429c7f9c6..53220fc0605 100644 --- a/crates/iota-graphql-rpc/src/server/version.rs +++ b/crates/iota-graphql-rpc/src/server/version.rs @@ -146,7 +146,7 @@ mod tests { use axum::{body::Body, middleware, routing::get, Router}; use expect_test::expect; use http_body_util::BodyExt; - use mysten_metrics; + use iota_metrics; use tokio_util::sync::CancellationToken; use tower::ServiceExt; @@ -159,7 +159,7 @@ mod tests { fn metrics() -> Metrics { let binding_address: SocketAddr = "0.0.0.0:9185".parse().unwrap(); - let registry = mysten_metrics::start_prometheus_server(binding_address).default_registry(); + let registry = iota_metrics::start_prometheus_server(binding_address).default_registry(); Metrics::new(®istry) } fn service() -> Router { diff --git a/crates/iota-indexer/Cargo.toml b/crates/iota-indexer/Cargo.toml index b60e6d4f365..008d4314f82 100644 --- a/crates/iota-indexer/Cargo.toml +++ b/crates/iota-indexer/Cargo.toml @@ -34,13 +34,13 @@ iota-json.workspace = true iota-json-rpc.workspace = true iota-json-rpc-api.workspace = true iota-json-rpc-types.workspace = true +iota-metrics.workspace = true iota-open-rpc.workspace = true iota-package-resolver.workspace = true iota-protocol-config.workspace = true iota-rest-api.workspace = true iota-transaction-builder.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true telemetry-subscribers.workspace = true move-binary-format.workspace = true diff --git a/crates/iota-indexer/src/framework/builder.rs b/crates/iota-indexer/src/framework/builder.rs index 5cafaf45d59..22c84239b28 100644 --- a/crates/iota-indexer/src/framework/builder.rs +++ b/crates/iota-indexer/src/framework/builder.rs @@ -54,9 +54,9 @@ impl IndexerBuilder { pub async fn run(self) { let (downloaded_checkpoint_data_sender, downloaded_checkpoint_data_receiver) = - mysten_metrics::metered_channel::channel( + iota_metrics::metered_channel::channel( self.checkpoint_buffer_size, - &mysten_metrics::get_metrics() + &iota_metrics::get_metrics() .unwrap() .channels .with_label_values(&["checkpoint_tx_downloading"]), @@ -71,14 +71,12 @@ impl IndexerBuilder { downloaded_checkpoint_data_sender, self.metrics.clone(), ); - mysten_metrics::spawn_monitored_task!(fetcher.run()); + iota_metrics::spawn_monitored_task!(fetcher.run()); assert!(!self.handlers.is_empty()); super::runner::run( - mysten_metrics::metered_channel::ReceiverStream::new( - downloaded_checkpoint_data_receiver, - ), + iota_metrics::metered_channel::ReceiverStream::new(downloaded_checkpoint_data_receiver), self.handlers, self.metrics.clone(), ) diff --git a/crates/iota-indexer/src/framework/fetcher.rs b/crates/iota-indexer/src/framework/fetcher.rs index 9bdcb88f49b..9e9376f4fa9 100644 --- a/crates/iota-indexer/src/framework/fetcher.rs +++ b/crates/iota-indexer/src/framework/fetcher.rs @@ -18,7 +18,7 @@ pub struct CheckpointFetcher { client: Client, last_downloaded_checkpoint: Option, highest_known_checkpoint: CheckpointSequenceNumber, - sender: mysten_metrics::metered_channel::Sender, + sender: iota_metrics::metered_channel::Sender, metrics: IndexerMetrics, } @@ -29,7 +29,7 @@ impl CheckpointFetcher { pub fn new( client: Client, last_downloaded_checkpoint: Option, - sender: mysten_metrics::metered_channel::Sender, + sender: iota_metrics::metered_channel::Sender, metrics: IndexerMetrics, ) -> Self { Self { diff --git a/crates/iota-indexer/src/handlers/checkpoint_handler.rs b/crates/iota-indexer/src/handlers/checkpoint_handler.rs index 02570d81e0d..5773170e477 100644 --- a/crates/iota-indexer/src/handlers/checkpoint_handler.rs +++ b/crates/iota-indexer/src/handlers/checkpoint_handler.rs @@ -9,6 +9,7 @@ use std::{ use async_trait::async_trait; use iota_json_rpc_types::IotaMoveValue; +use iota_metrics::{get_metrics, spawn_monitored_task}; use iota_package_resolver::{PackageStore, Resolver}; use iota_rest_api::{CheckpointData, CheckpointTransaction}; use iota_types::{ @@ -29,7 +30,6 @@ use move_core_types::{ annotated_value::{MoveStructLayout, MoveTypeLayout}, language_storage::{StructTag, TypeTag}, }; -use mysten_metrics::{get_metrics, spawn_monitored_task}; use tap::tap::TapFallible; use tokio::sync::watch; use tracing::{error, info, warn}; @@ -70,7 +70,7 @@ where .unwrap(); let global_metrics = get_metrics().unwrap(); let (indexed_checkpoint_sender, indexed_checkpoint_receiver) = - mysten_metrics::metered_channel::channel( + iota_metrics::metered_channel::channel( checkpoint_queue_size, &global_metrics .channels @@ -100,7 +100,7 @@ where pub struct CheckpointHandler { state: S, metrics: IndexerMetrics, - indexed_checkpoint_sender: mysten_metrics::metered_channel::Sender, + indexed_checkpoint_sender: iota_metrics::metered_channel::Sender, // buffers for packages that are being indexed but not committed to DB, // they will be periodically GCed to avoid OOM. package_buffer: Arc>, diff --git a/crates/iota-indexer/src/handlers/committer.rs b/crates/iota-indexer/src/handlers/committer.rs index 41df65e55de..2162f071ed5 100644 --- a/crates/iota-indexer/src/handlers/committer.rs +++ b/crates/iota-indexer/src/handlers/committer.rs @@ -17,7 +17,7 @@ const CHECKPOINT_COMMIT_BATCH_SIZE: usize = 100; pub async fn start_tx_checkpoint_commit_task( state: S, metrics: IndexerMetrics, - tx_indexing_receiver: mysten_metrics::metered_channel::Receiver, + tx_indexing_receiver: iota_metrics::metered_channel::Receiver, commit_notifier: watch::Sender>, ) where S: IndexerStore + Clone + Sync + Send + 'static, @@ -31,7 +31,7 @@ pub async fn start_tx_checkpoint_commit_task( .unwrap(); info!("Using checkpoint commit batch size {checkpoint_commit_batch_size}"); - let mut stream = mysten_metrics::metered_channel::ReceiverStream::new(tx_indexing_receiver) + let mut stream = iota_metrics::metered_channel::ReceiverStream::new(tx_indexing_receiver) .ready_chunks(checkpoint_commit_batch_size); while let Some(indexed_checkpoint_batch) = stream.next().await { diff --git a/crates/iota-indexer/src/handlers/tx_processor.rs b/crates/iota-indexer/src/handlers/tx_processor.rs index aa8934d95d9..c5210f60dad 100644 --- a/crates/iota-indexer/src/handlers/tx_processor.rs +++ b/crates/iota-indexer/src/handlers/tx_processor.rs @@ -12,6 +12,7 @@ use std::{ use async_trait::async_trait; use iota_json_rpc::{get_balance_changes_from_effect, get_object_changes, ObjectProvider}; +use iota_metrics::{monitored_scope, spawn_monitored_task}; use iota_rest_api::CheckpointData; use iota_types::{ base_types::{ObjectID, SequenceNumber}, @@ -23,7 +24,6 @@ use iota_types::{ }; use move_binary_format::CompiledModule; use move_core_types::language_storage::ModuleId; -use mysten_metrics::{monitored_scope, spawn_monitored_task}; use tokio::{ sync::watch, time::{Duration, Instant}, diff --git a/crates/iota-indexer/src/indexer.rs b/crates/iota-indexer/src/indexer.rs index 41ba04d54e5..3e43a9faa93 100644 --- a/crates/iota-indexer/src/indexer.rs +++ b/crates/iota-indexer/src/indexer.rs @@ -5,7 +5,7 @@ use std::env; use anyhow::Result; -use mysten_metrics::spawn_monitored_task; +use iota_metrics::spawn_monitored_task; use prometheus::Registry; use tracing::info; @@ -58,9 +58,9 @@ impl Indexer { .parse::() .expect("Invalid DOWNLOAD_QUEUE_SIZE"); let (downloaded_checkpoint_data_sender, downloaded_checkpoint_data_receiver) = - mysten_metrics::metered_channel::channel( + iota_metrics::metered_channel::channel( download_queue_size, - &mysten_metrics::get_metrics() + &iota_metrics::get_metrics() .unwrap() .channels .with_label_values(&["checkpoint_tx_downloading"]), @@ -85,9 +85,7 @@ impl Indexer { let checkpoint_handler = new_handlers(store, metrics.clone()).await?; crate::framework::runner::run( - mysten_metrics::metered_channel::ReceiverStream::new( - downloaded_checkpoint_data_receiver, - ), + iota_metrics::metered_channel::ReceiverStream::new(downloaded_checkpoint_data_receiver), vec![Box::new(checkpoint_handler)], metrics, ) diff --git a/crates/iota-indexer/src/main.rs b/crates/iota-indexer/src/main.rs index bca3acdfe82..05209dc433a 100644 --- a/crates/iota-indexer/src/main.rs +++ b/crates/iota-indexer/src/main.rs @@ -66,7 +66,7 @@ async fn main() -> Result<(), IndexerError> { indexer_config.rpc_client_url.as_str(), )?; let indexer_metrics = IndexerMetrics::new(®istry); - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); let report_cp = blocking_cp.clone(); let report_metrics = indexer_metrics.clone(); diff --git a/crates/iota-indexer/src/metrics.rs b/crates/iota-indexer/src/metrics.rs index 804bd8c9e7f..b4102f13f66 100644 --- a/crates/iota-indexer/src/metrics.rs +++ b/crates/iota-indexer/src/metrics.rs @@ -5,7 +5,7 @@ use std::{collections::HashMap, net::SocketAddr}; use axum::{extract::Extension, http::StatusCode, routing::get, Router}; -use mysten_metrics::RegistryService; +use iota_metrics::RegistryService; use prometheus::{ register_histogram_with_registry, register_int_counter_with_registry, register_int_gauge_with_registry, Histogram, IntCounter, IntGauge, Registry, TextEncoder, diff --git a/crates/iota-indexer/src/test_utils.rs b/crates/iota-indexer/src/test_utils.rs index 7f54fed35b7..9d938570fcb 100644 --- a/crates/iota-indexer/src/test_utils.rs +++ b/crates/iota-indexer/src/test_utils.rs @@ -6,7 +6,7 @@ use std::{env, net::SocketAddr, time::Duration}; use diesel::connection::SimpleConnection; use iota_json_rpc_types::IotaTransactionBlockResponse; -use mysten_metrics::init_metrics; +use iota_metrics::init_metrics; use tokio::task::JoinHandle; use tracing::info; diff --git a/crates/iota-json-rpc-api/Cargo.toml b/crates/iota-json-rpc-api/Cargo.toml index 0b11c12bc20..752290b4c5b 100644 --- a/crates/iota-json-rpc-api/Cargo.toml +++ b/crates/iota-json-rpc-api/Cargo.toml @@ -11,11 +11,11 @@ anyhow.workspace = true fastcrypto.workspace = true iota-json.workspace = true iota-json-rpc-types.workspace = true +iota-metrics.workspace = true iota-open-rpc.workspace = true iota-open-rpc-macros.workspace = true iota-types.workspace = true jsonrpsee.workspace = true -mysten-metrics.workspace = true once_cell.workspace = true prometheus.workspace = true tap.workspace = true diff --git a/crates/iota-json-rpc-api/src/lib.rs b/crates/iota-json-rpc-api/src/lib.rs index 40619d86764..cd11955de1d 100644 --- a/crates/iota-json-rpc-api/src/lib.rs +++ b/crates/iota-json-rpc-api/src/lib.rs @@ -11,6 +11,7 @@ pub use coin::{CoinReadApiClient, CoinReadApiOpenRpc, CoinReadApiServer}; pub use extended::{ExtendedApiClient, ExtendedApiOpenRpc, ExtendedApiServer}; pub use governance::{GovernanceReadApiClient, GovernanceReadApiOpenRpc, GovernanceReadApiServer}; pub use indexer::{IndexerApiClient, IndexerApiOpenRpc, IndexerApiServer}; +use iota_metrics::histogram::Histogram; use jsonrpsee::{ core::ClientError, types::{ @@ -19,7 +20,6 @@ use jsonrpsee::{ }, }; pub use move_utils::{MoveUtilsClient, MoveUtilsOpenRpc, MoveUtilsServer}; -use mysten_metrics::histogram::Histogram; use once_cell::sync::Lazy; use prometheus::{register_int_counter_with_registry, IntCounter}; pub use read::{ReadApiClient, ReadApiOpenRpc, ReadApiServer}; diff --git a/crates/iota-json-rpc-types/Cargo.toml b/crates/iota-json-rpc-types/Cargo.toml index 78c52965a3f..96baec66d2e 100644 --- a/crates/iota-json-rpc-types/Cargo.toml +++ b/crates/iota-json-rpc-types/Cargo.toml @@ -29,8 +29,8 @@ move-bytecode-utils.workspace = true move-core-types.workspace = true iota-json.workspace = true +iota-metrics.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true [dev-dependencies] iota-types = { workspace = true, features = ["test-utils"] } diff --git a/crates/iota-json-rpc-types/src/iota_event.rs b/crates/iota-json-rpc-types/src/iota_event.rs index 8da82fb0a3f..15fceee3020 100644 --- a/crates/iota-json-rpc-types/src/iota_event.rs +++ b/crates/iota-json-rpc-types/src/iota_event.rs @@ -7,6 +7,7 @@ use std::str::FromStr; use std::{fmt, fmt::Display}; use fastcrypto::encoding::{Base58, Base64}; +use iota_metrics::monitored_scope; use iota_types::{ base_types::{IotaAddress, ObjectID, TransactionDigest}, error::IotaResult, @@ -17,7 +18,6 @@ use json_to_table::json_to_table; use move_core_types::{ annotated_value::MoveStructLayout, identifier::Identifier, language_storage::StructTag, }; -use mysten_metrics::monitored_scope; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; diff --git a/crates/iota-json-rpc-types/src/iota_transaction.rs b/crates/iota-json-rpc-types/src/iota_transaction.rs index 8c954049d48..9a40e65bcb4 100644 --- a/crates/iota-json-rpc-types/src/iota_transaction.rs +++ b/crates/iota-json-rpc-types/src/iota_transaction.rs @@ -7,6 +7,7 @@ use std::fmt::{self, Display, Formatter, Write}; use enum_dispatch::enum_dispatch; use fastcrypto::encoding::Base64; use iota_json::{primitive_type, IotaJsonValue}; +use iota_metrics::monitored_scope; use iota_types::{ authenticator_state::ActiveJwk, base_types::{EpochId, IotaAddress, ObjectID, ObjectRef, SequenceNumber, TransactionDigest}, @@ -41,7 +42,6 @@ use move_core_types::{ identifier::IdentStr, language_storage::{ModuleId, StructTag, TypeTag}, }; -use mysten_metrics::monitored_scope; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_with::serde_as; diff --git a/crates/iota-json-rpc/Cargo.toml b/crates/iota-json-rpc/Cargo.toml index aa86a499e66..33c708f6e30 100644 --- a/crates/iota-json-rpc/Cargo.toml +++ b/crates/iota-json-rpc/Cargo.toml @@ -42,13 +42,13 @@ iota-core.workspace = true iota-json.workspace = true iota-json-rpc-api.workspace = true iota-json-rpc-types.workspace = true +iota-metrics.workspace = true iota-open-rpc.workspace = true iota-open-rpc-macros.workspace = true iota-protocol-config.workspace = true iota-storage.workspace = true iota-transaction-builder.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true shared-crypto.workspace = true typed-store-error.workspace = true diff --git a/crates/iota-json-rpc/src/coin_api.rs b/crates/iota-json-rpc/src/coin_api.rs index b8ec4c79e78..216c4326bfa 100644 --- a/crates/iota-json-rpc/src/coin_api.rs +++ b/crates/iota-json-rpc/src/coin_api.rs @@ -9,6 +9,7 @@ use cached::{proc_macro::cached, SizedCache}; use iota_core::authority::AuthorityState; use iota_json_rpc_api::{cap_page_limit, CoinReadApiOpenRpc, CoinReadApiServer, JsonRpcMetrics}; use iota_json_rpc_types::{Balance, CoinPage, IotaCoinMetadata}; +use iota_metrics::spawn_monitored_task; use iota_open_rpc::Module; use iota_storage::{indexes::TotalBalance, key_value_store::TransactionKeyValueStore}; use iota_types::{ @@ -25,7 +26,6 @@ use jsonrpsee::{core::RpcResult, RpcModule}; #[cfg(test)] use mockall::automock; use move_core_types::language_storage::{StructTag, TypeTag}; -use mysten_metrics::spawn_monitored_task; use tap::TapFallible; use tracing::{debug, instrument}; diff --git a/crates/iota-json-rpc/src/governance_api.rs b/crates/iota-json-rpc/src/governance_api.rs index 12d1ae0b9a8..189fdf88f6e 100644 --- a/crates/iota-json-rpc/src/governance_api.rs +++ b/crates/iota-json-rpc/src/governance_api.rs @@ -14,6 +14,7 @@ use iota_json_rpc_types::{ DelegatedStake, DelegatedTimelockedStake, IotaCommittee, Stake, StakeStatus, TimelockedStake, ValidatorApy, ValidatorApys, }; +use iota_metrics::spawn_monitored_task; use iota_open_rpc::Module; use iota_types::{ base_types::{IotaAddress, ObjectID}, @@ -32,7 +33,6 @@ use iota_types::{ }; use itertools::Itertools; use jsonrpsee::{core::RpcResult, RpcModule}; -use mysten_metrics::spawn_monitored_task; use tracing::{info, instrument}; use crate::{ diff --git a/crates/iota-json-rpc/src/indexer_api.rs b/crates/iota-json-rpc/src/indexer_api.rs index d6e8d41cbdf..aae2497f44f 100644 --- a/crates/iota-json-rpc/src/indexer_api.rs +++ b/crates/iota-json-rpc/src/indexer_api.rs @@ -18,6 +18,7 @@ use iota_json_rpc_types::{ IotaObjectResponseQuery, IotaTransactionBlockResponse, IotaTransactionBlockResponseQuery, ObjectsPage, Page, TransactionBlocksPage, TransactionFilter, }; +use iota_metrics::spawn_monitored_task; use iota_open_rpc::Module; use iota_storage::key_value_store::TransactionKeyValueStore; use iota_types::{ @@ -32,7 +33,6 @@ use jsonrpsee::{ }; use move_bytecode_utils::layout::TypeLayoutBuilder; use move_core_types::language_storage::TypeTag; -use mysten_metrics::spawn_monitored_task; use serde::Serialize; use tokio::sync::{OwnedSemaphorePermit, Semaphore}; use tracing::{debug, instrument}; diff --git a/crates/iota-json-rpc/src/read_api.rs b/crates/iota-json-rpc/src/read_api.rs index 5af4127529c..d1b7b477faa 100644 --- a/crates/iota-json-rpc/src/read_api.rs +++ b/crates/iota-json-rpc/src/read_api.rs @@ -21,6 +21,7 @@ use iota_json_rpc_types::{ IotaTransactionBlockResponse, IotaTransactionBlockResponseOptions, ObjectChange, ProtocolConfigResponse, }; +use iota_metrics::spawn_monitored_task; use iota_open_rpc::Module; use iota_protocol_config::{ProtocolConfig, ProtocolVersion}; use iota_storage::key_value_store::TransactionKeyValueStore; @@ -47,7 +48,6 @@ use move_core_types::{ annotated_value::{MoveStruct, MoveStructLayout, MoveValue}, language_storage::StructTag, }; -use mysten_metrics::spawn_monitored_task; use tap::TapFallible; use tracing::{debug, error, instrument, trace, warn}; diff --git a/crates/iota-json-rpc/src/transaction_execution_api.rs b/crates/iota-json-rpc/src/transaction_execution_api.rs index 1ec0e7602d9..99a594e552f 100644 --- a/crates/iota-json-rpc/src/transaction_execution_api.rs +++ b/crates/iota-json-rpc/src/transaction_execution_api.rs @@ -15,6 +15,7 @@ use iota_json_rpc_types::{ DevInspectArgs, DevInspectResults, DryRunTransactionBlockResponse, IotaTransactionBlock, IotaTransactionBlockEvents, IotaTransactionBlockResponse, IotaTransactionBlockResponseOptions, }; +use iota_metrics::spawn_monitored_task; use iota_open_rpc::Module; use iota_types::{ base_types::IotaAddress, @@ -31,7 +32,6 @@ use iota_types::{ }, }; use jsonrpsee::{core::RpcResult, RpcModule}; -use mysten_metrics::spawn_monitored_task; use shared_crypto::intent::{AppId, Intent, IntentMessage, IntentScope, IntentVersion}; use tracing::instrument; diff --git a/crates/mysten-metrics/Cargo.toml b/crates/iota-metrics/Cargo.toml similarity index 95% rename from crates/mysten-metrics/Cargo.toml rename to crates/iota-metrics/Cargo.toml index a7f74f65622..d1919fcfc4f 100644 --- a/crates/mysten-metrics/Cargo.toml +++ b/crates/iota-metrics/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mysten-metrics" +name = "iota-metrics" version = "0.7.0" authors = ["IOTA Foundation "] edition = "2021" diff --git a/crates/mysten-metrics/src/guards.rs b/crates/iota-metrics/src/guards.rs similarity index 100% rename from crates/mysten-metrics/src/guards.rs rename to crates/iota-metrics/src/guards.rs diff --git a/crates/mysten-metrics/src/histogram.rs b/crates/iota-metrics/src/histogram.rs similarity index 100% rename from crates/mysten-metrics/src/histogram.rs rename to crates/iota-metrics/src/histogram.rs diff --git a/crates/mysten-metrics/src/lib.rs b/crates/iota-metrics/src/lib.rs similarity index 96% rename from crates/mysten-metrics/src/lib.rs rename to crates/iota-metrics/src/lib.rs index a3426f1ed2f..a262558997c 100644 --- a/crates/mysten-metrics/src/lib.rs +++ b/crates/iota-metrics/src/lib.rs @@ -112,18 +112,18 @@ macro_rules! monitored_future { }; async move { - let metrics = mysten_metrics::get_metrics(); + let metrics = iota_metrics::get_metrics(); let _metrics_guard = if let Some(m) = metrics { m.$metric.with_label_values(&[location]).inc(); - Some(mysten_metrics::scopeguard::guard(m, |metrics| { + Some(iota_metrics::scopeguard::guard(m, |metrics| { m.$metric.with_label_values(&[location]).dec(); })) } else { None }; let _logging_guard = if $logging_enabled { - Some(mysten_metrics::scopeguard::guard((), |_| { + Some(iota_metrics::scopeguard::guard((), |_| { tracing::event!( tracing::Level::$logging_level, "Future {} completed", @@ -150,7 +150,7 @@ macro_rules! monitored_future { #[macro_export] macro_rules! spawn_monitored_task { ($fut: expr) => { - tokio::task::spawn(mysten_metrics::monitored_future!( + tokio::task::spawn(iota_metrics::monitored_future!( tasks, $fut, "", INFO, false )) }; @@ -159,19 +159,17 @@ macro_rules! spawn_monitored_task { #[macro_export] macro_rules! spawn_logged_monitored_task { ($fut: expr) => { - tokio::task::spawn(mysten_metrics::monitored_future!( - tasks, $fut, "", INFO, true - )) + tokio::task::spawn(iota_metrics::monitored_future!(tasks, $fut, "", INFO, true)) }; ($fut: expr, $name: expr) => { - tokio::task::spawn(mysten_metrics::monitored_future!( + tokio::task::spawn(iota_metrics::monitored_future!( tasks, $fut, $name, INFO, true )) }; ($fut: expr, $name: expr, $logging_level: ident) => { - tokio::task::spawn(mysten_metrics::monitored_future!( + tokio::task::spawn(iota_metrics::monitored_future!( tasks, $fut, $name, diff --git a/crates/mysten-metrics/src/metered_channel.rs b/crates/iota-metrics/src/metered_channel.rs similarity index 100% rename from crates/mysten-metrics/src/metered_channel.rs rename to crates/iota-metrics/src/metered_channel.rs diff --git a/crates/mysten-metrics/src/tests/metered_channel_tests.rs b/crates/iota-metrics/src/tests/metered_channel_tests.rs similarity index 100% rename from crates/mysten-metrics/src/tests/metered_channel_tests.rs rename to crates/iota-metrics/src/tests/metered_channel_tests.rs diff --git a/crates/iota-move/Cargo.toml b/crates/iota-move/Cargo.toml index d24346e6fe5..0fb14183fa1 100644 --- a/crates/iota-move/Cargo.toml +++ b/crates/iota-move/Cargo.toml @@ -42,7 +42,7 @@ tempfile.workspace = true move-package.workspace = true iota-macros.workspace = true -mysten-metrics.workspace = true +iota-metrics.workspace = true [features] default = [] diff --git a/crates/mysten-network/Cargo.toml b/crates/iota-network-stack/Cargo.toml similarity index 96% rename from crates/mysten-network/Cargo.toml rename to crates/iota-network-stack/Cargo.toml index 993626328bd..3747fe0b33a 100644 --- a/crates/mysten-network/Cargo.toml +++ b/crates/iota-network-stack/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mysten-network" +name = "iota-network-stack" version = "0.2.0" authors = ["IOTA Foundation "] edition = "2021" diff --git a/crates/mysten-network/src/anemo_ext.rs b/crates/iota-network-stack/src/anemo_ext.rs similarity index 100% rename from crates/mysten-network/src/anemo_ext.rs rename to crates/iota-network-stack/src/anemo_ext.rs diff --git a/crates/mysten-network/src/callback/future.rs b/crates/iota-network-stack/src/callback/future.rs similarity index 100% rename from crates/mysten-network/src/callback/future.rs rename to crates/iota-network-stack/src/callback/future.rs diff --git a/crates/mysten-network/src/callback/layer.rs b/crates/iota-network-stack/src/callback/layer.rs similarity index 100% rename from crates/mysten-network/src/callback/layer.rs rename to crates/iota-network-stack/src/callback/layer.rs diff --git a/crates/mysten-network/src/callback/mod.rs b/crates/iota-network-stack/src/callback/mod.rs similarity index 100% rename from crates/mysten-network/src/callback/mod.rs rename to crates/iota-network-stack/src/callback/mod.rs diff --git a/crates/mysten-network/src/callback/service.rs b/crates/iota-network-stack/src/callback/service.rs similarity index 100% rename from crates/mysten-network/src/callback/service.rs rename to crates/iota-network-stack/src/callback/service.rs diff --git a/crates/mysten-network/src/client.rs b/crates/iota-network-stack/src/client.rs similarity index 100% rename from crates/mysten-network/src/client.rs rename to crates/iota-network-stack/src/client.rs diff --git a/crates/mysten-network/src/codec.rs b/crates/iota-network-stack/src/codec.rs similarity index 100% rename from crates/mysten-network/src/codec.rs rename to crates/iota-network-stack/src/codec.rs diff --git a/crates/mysten-network/src/config.rs b/crates/iota-network-stack/src/config.rs similarity index 100% rename from crates/mysten-network/src/config.rs rename to crates/iota-network-stack/src/config.rs diff --git a/crates/mysten-network/src/lib.rs b/crates/iota-network-stack/src/lib.rs similarity index 100% rename from crates/mysten-network/src/lib.rs rename to crates/iota-network-stack/src/lib.rs diff --git a/crates/mysten-network/src/metrics.rs b/crates/iota-network-stack/src/metrics.rs similarity index 100% rename from crates/mysten-network/src/metrics.rs rename to crates/iota-network-stack/src/metrics.rs diff --git a/crates/mysten-network/src/multiaddr.rs b/crates/iota-network-stack/src/multiaddr.rs similarity index 100% rename from crates/mysten-network/src/multiaddr.rs rename to crates/iota-network-stack/src/multiaddr.rs diff --git a/crates/mysten-network/src/server.rs b/crates/iota-network-stack/src/server.rs similarity index 100% rename from crates/mysten-network/src/server.rs rename to crates/iota-network-stack/src/server.rs diff --git a/crates/iota-network/Cargo.toml b/crates/iota-network/Cargo.toml index f46fd780fec..3bd0cf073ea 100644 --- a/crates/iota-network/Cargo.toml +++ b/crates/iota-network/Cargo.toml @@ -27,8 +27,8 @@ bytes.workspace = true fastcrypto.workspace = true fastcrypto-tbls.workspace = true futures.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true prometheus.workspace = true rand.workspace = true tap.workspace = true diff --git a/crates/iota-network/build.rs b/crates/iota-network/build.rs index 500f49e2deb..2ef2c908169 100644 --- a/crates/iota-network/build.rs +++ b/crates/iota-network/build.rs @@ -18,7 +18,7 @@ fn main() -> Result<()> { PathBuf::from(env::var("OUT_DIR")?) }; - let codec_path = "mysten_network::codec::BcsCodec"; + let codec_path = "iota_network_stack::codec::BcsCodec"; let validator_service = Service::builder() .name("Validator") @@ -111,7 +111,7 @@ fn main() -> Result<()> { } fn build_anemo_services(out_dir: &Path) { - let codec_path = "mysten_network::codec::anemo::BcsSnappyCodec"; + let codec_path = "iota_network_stack::codec::anemo::BcsSnappyCodec"; let discovery = anemo_build::manual::Service::builder() .name("Discovery") diff --git a/crates/iota-network/src/lib.rs b/crates/iota-network/src/lib.rs index 886cb00221b..349ee3a1f2d 100644 --- a/crates/iota-network/src/lib.rs +++ b/crates/iota-network/src/lib.rs @@ -4,7 +4,7 @@ use std::time::Duration; -use mysten_network::config::Config; +use iota_network_stack::config::Config; pub mod api; pub mod discovery; @@ -18,8 +18,8 @@ pub const DEFAULT_CONNECT_TIMEOUT_SEC: Duration = Duration::from_secs(10); pub const DEFAULT_REQUEST_TIMEOUT_SEC: Duration = Duration::from_secs(30); pub const DEFAULT_HTTP2_KEEPALIVE_SEC: Duration = Duration::from_secs(5); -pub fn default_mysten_network_config() -> Config { - let mut net_config = mysten_network::config::Config::new(); +pub fn default_iota_network_stack_config() -> Config { + let mut net_config = iota_network_stack::config::Config::new(); net_config.connect_timeout = Some(DEFAULT_CONNECT_TIMEOUT_SEC); net_config.request_timeout = Some(DEFAULT_REQUEST_TIMEOUT_SEC); net_config.http2_keepalive_interval = Some(DEFAULT_HTTP2_KEEPALIVE_SEC); diff --git a/crates/iota-network/src/randomness/mod.rs b/crates/iota-network/src/randomness/mod.rs index a622aeafc25..9754df998ee 100644 --- a/crates/iota-network/src/randomness/mod.rs +++ b/crates/iota-network/src/randomness/mod.rs @@ -14,13 +14,13 @@ use anyhow::Result; use fastcrypto::groups::bls12381; use fastcrypto_tbls::{dkg, nodes::PartyId, tbls::ThresholdBls, types::ThresholdBls12381MinSig}; use iota_config::p2p::RandomnessConfig; +use iota_metrics::spawn_monitored_task; +use iota_network_stack::anemo_ext::NetworkExt; use iota_types::{ base_types::AuthorityName, committee::EpochId, crypto::{RandomnessPartialSignature, RandomnessRound, RandomnessSignature}, }; -use mysten_metrics::spawn_monitored_task; -use mysten_network::anemo_ext::NetworkExt; use serde::{Deserialize, Serialize}; use tokio::sync::mpsc; use tracing::{debug, error, info, instrument, warn}; diff --git a/crates/iota-network/src/state_sync/metrics.rs b/crates/iota-network/src/state_sync/metrics.rs index 4e5339fe4cd..26e135f3222 100644 --- a/crates/iota-network/src/state_sync/metrics.rs +++ b/crates/iota-network/src/state_sync/metrics.rs @@ -4,8 +4,8 @@ use std::sync::Arc; +use iota_metrics::histogram::Histogram; use iota_types::messages_checkpoint::CheckpointSequenceNumber; -use mysten_metrics::histogram::Histogram; use prometheus::{register_int_gauge_with_registry, IntGauge, Registry}; use tap::Pipe; diff --git a/crates/iota-node/Cargo.toml b/crates/iota-node/Cargo.toml index 84de00726fc..d5272ee3c39 100644 --- a/crates/iota-node/Cargo.toml +++ b/crates/iota-node/Cargo.toml @@ -30,21 +30,21 @@ url.workspace = true fastcrypto.workspace = true fastcrypto-zkp.workspace = true iota-archival.workspace = true +iota-common.workspace = true iota-config.workspace = true iota-core.workspace = true iota-json-rpc.workspace = true iota-json-rpc-api.workspace = true iota-macros.workspace = true +iota-metrics.workspace = true iota-network.workspace = true +iota-network-stack.workspace = true iota-protocol-config.workspace = true iota-rest-api.workspace = true iota-snapshot.workspace = true iota-storage.workspace = true iota-types.workspace = true move-vm-profiler.workspace = true -mysten-common.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true narwhal-network.workspace = true narwhal-worker.workspace = true telemetry-subscribers.workspace = true diff --git a/crates/iota-node/src/lib.rs b/crates/iota-node/src/lib.rs index 32b0368a436..aa0d3019a31 100644 --- a/crates/iota-node/src/lib.rs +++ b/crates/iota-node/src/lib.rs @@ -78,9 +78,11 @@ use iota_json_rpc::{ }; use iota_json_rpc_api::JsonRpcMetrics; use iota_macros::{fail_point, fail_point_async, replay_log}; +use iota_metrics::{spawn_monitored_task, RegistryService}; use iota_network::{ api::ValidatorServer, discovery, discovery::TrustedPeerChangeEvent, randomness, state_sync, }; +use iota_network_stack::server::ServerBuilder; use iota_protocol_config::{Chain, ProtocolConfig, ProtocolVersion, SupportedProtocolVersions}; use iota_snapshot::uploader::StateSnapshotUploader; use iota_storage::{ @@ -103,8 +105,6 @@ use iota_types::{ messages_consensus::{check_total_jwk_size, AuthorityCapabilities, ConsensusTransaction}, quorum_driver_types::QuorumDriverEffectsQueueResult, }; -use mysten_metrics::{spawn_monitored_task, RegistryService}; -use mysten_network::server::ServerBuilder; use narwhal_network::metrics::{ MetricsMakeCallbackHandler, NetworkConnectionMetrics, NetworkMetrics, }; @@ -422,7 +422,7 @@ impl IotaNode { // Initialize metrics to track db usage before creating any stores DBMetrics::init(&prometheus_registry); - mysten_metrics::init_metrics(&prometheus_registry); + iota_metrics::init_metrics(&prometheus_registry); let genesis = config.genesis()?; @@ -1411,7 +1411,7 @@ impl IotaNode { Arc::new(ValidatorServiceMetrics::new(prometheus_registry)), ); - let mut server_conf = mysten_network::config::Config::new(); + let mut server_conf = iota_network_stack::config::Config::new(); server_conf.global_concurrency_limit = config.grpc_concurrency_limit; server_conf.load_shed = config.grpc_load_shed; let mut server_builder = diff --git a/crates/iota-node/src/main.rs b/crates/iota-node/src/main.rs index 9f6fc3bf577..b132cc12eea 100644 --- a/crates/iota-node/src/main.rs +++ b/crates/iota-node/src/main.rs @@ -5,6 +5,7 @@ use std::{path::PathBuf, sync::Arc, time::Duration}; use clap::{ArgGroup, Parser}; +use iota_common::sync::async_once_cell::AsyncOnceCell; use iota_config::{node::RunWithRange, Config, NodeConfig}; use iota_core::runtime::IotaRuntimes; use iota_node::IotaNode; @@ -12,7 +13,6 @@ use iota_protocol_config::SupportedProtocolVersions; use iota_types::{ committee::EpochId, messages_checkpoint::CheckpointSequenceNumber, multiaddr::Multiaddr, }; -use mysten_common::sync::async_once_cell::AsyncOnceCell; use tokio::sync::broadcast; use tracing::{error, info}; @@ -84,7 +84,7 @@ fn main() { let runtimes = IotaRuntimes::new(&config); let metrics_rt = runtimes.metrics.enter(); - let registry_service = mysten_metrics::start_prometheus_server(config.metrics_address); + let registry_service = iota_metrics::start_prometheus_server(config.metrics_address); let prometheus_registry = registry_service.default_registry(); // Initialize logging @@ -160,7 +160,7 @@ fn main() { info!("Iota chain identifier: {chain_identifier}"); prometheus_registry - .register(mysten_metrics::uptime_metric( + .register(iota_metrics::uptime_metric( if is_validator { "validator" } else { diff --git a/crates/iota-node/src/metrics.rs b/crates/iota-node/src/metrics.rs index 6513d6e366e..1376be5a29a 100644 --- a/crates/iota-node/src/metrics.rs +++ b/crates/iota-node/src/metrics.rs @@ -5,7 +5,7 @@ use std::time::Duration; use iota_network::tonic::Code; -use mysten_network::metrics::MetricsCallbackProvider; +use iota_network_stack::metrics::MetricsCallbackProvider; use prometheus::{ register_histogram_vec_with_registry, register_int_counter_vec_with_registry, register_int_gauge_vec_with_registry, HistogramVec, IntCounterVec, IntGaugeVec, Registry, @@ -127,7 +127,7 @@ impl MetricsCallbackProvider for GrpcMetrics { mod tests { use std::net::{IpAddr, Ipv4Addr, SocketAddr}; - use mysten_metrics::start_prometheus_server; + use iota_metrics::start_prometheus_server; use prometheus::{IntCounter, Registry}; #[tokio::test] diff --git a/crates/iota-rosetta/Cargo.toml b/crates/iota-rosetta/Cargo.toml index aa3088116c7..f026dad50d9 100644 --- a/crates/iota-rosetta/Cargo.toml +++ b/crates/iota-rosetta/Cargo.toml @@ -20,11 +20,11 @@ hyper.workspace = true iota-config.workspace = true iota-json-rpc-types.workspace = true iota-keys.workspace = true +iota-metrics.workspace = true iota-node.workspace = true iota-sdk.workspace = true iota-swarm-config.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true once_cell.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/iota-rosetta/src/lib.rs b/crates/iota-rosetta/src/lib.rs index ec33d8fe468..332efc91c0f 100644 --- a/crates/iota-rosetta/src/lib.rs +++ b/crates/iota-rosetta/src/lib.rs @@ -5,8 +5,8 @@ use std::{net::SocketAddr, sync::Arc}; use axum::{routing::post, Extension, Router}; +use iota_metrics::spawn_monitored_task; use iota_sdk::IotaClient; -use mysten_metrics::spawn_monitored_task; use once_cell::sync::Lazy; use tokio::task::JoinHandle; use tracing::info; diff --git a/crates/iota-rosetta/src/main.rs b/crates/iota-rosetta/src/main.rs index 44cd6086eaa..7a52c3ff7db 100644 --- a/crates/iota-rosetta/src/main.rs +++ b/crates/iota-rosetta/src/main.rs @@ -177,7 +177,7 @@ impl RosettaServerCommand { info!("Overriding Iota db path to : {:?}", config.db_path); let registry_service = - mysten_metrics::start_prometheus_server(config.metrics_address); + iota_metrics::start_prometheus_server(config.metrics_address); // Staring a full node for the rosetta server. let rpc_address = format!("http://127.0.0.1:{}", config.json_rpc_address.port()); let _node = IotaNode::start(config, registry_service, None).await?; diff --git a/crates/iota-source-validation-service/Cargo.toml b/crates/iota-source-validation-service/Cargo.toml index 2f2e341301e..57b2c0cd764 100644 --- a/crates/iota-source-validation-service/Cargo.toml +++ b/crates/iota-source-validation-service/Cargo.toml @@ -33,11 +33,11 @@ iota-source-validation.workspace = true axum.workspace = true const-str.workspace = true git-version.workspace = true +iota-metrics.workspace = true move-compiler.workspace = true move-core-types.workspace = true move-package.workspace = true move-symbol-pool.workspace = true -mysten-metrics.workspace = true prometheus.workspace = true telemetry-subscribers.workspace = true tower.workspace = true diff --git a/crates/iota-source-validation-service/src/lib.rs b/crates/iota-source-validation-service/src/lib.rs index c825df46d92..ef93606588c 100644 --- a/crates/iota-source-validation-service/src/lib.rs +++ b/crates/iota-source-validation-service/src/lib.rs @@ -24,6 +24,7 @@ use hyper::{ http::{HeaderName, HeaderValue, Method}, HeaderMap, StatusCode, }; +use iota_metrics::RegistryService; use iota_move::build::resolve_lock_file_path; use iota_move_build::{BuildConfig, IotaPackageHooks}; use iota_sdk::{ @@ -42,7 +43,6 @@ use jsonrpsee::{ use move_core_types::account_address::AccountAddress; use move_package::{BuildConfig as MoveBuildConfig, LintFlag}; use move_symbol_pool::Symbol; -use mysten_metrics::RegistryService; use prometheus::{register_int_counter_with_registry, IntCounter, Registry}; use serde::{Deserialize, Serialize}; use tokio::{net::TcpListener, sync::oneshot::Sender}; @@ -700,7 +700,7 @@ pub fn start_prometheus_server(listener: TcpListener) -> RegistryService { let registry_service = RegistryService::new(registry); let app = Router::new() - .route(METRICS_ROUTE, get(mysten_metrics::metrics)) + .route(METRICS_ROUTE, get(iota_metrics::metrics)) .layer(Extension(registry_service.clone())); tokio::spawn(async move { diff --git a/crates/iota-storage/Cargo.toml b/crates/iota-storage/Cargo.toml index f0508e155ad..66ef2187def 100644 --- a/crates/iota-storage/Cargo.toml +++ b/crates/iota-storage/Cargo.toml @@ -48,12 +48,12 @@ zstd = "0.13" iota-config.workspace = true iota-json-rpc-types.workspace = true +iota-metrics.workspace = true iota-protocol-config.workspace = true iota-types.workspace = true move-binary-format.workspace = true move-bytecode-utils.workspace = true move-core-types.workspace = true -mysten-metrics.workspace = true [dev-dependencies] anyhow.workspace = true diff --git a/crates/iota-storage/src/mutex_table.rs b/crates/iota-storage/src/mutex_table.rs index c371174ae0b..4209344b304 100644 --- a/crates/iota-storage/src/mutex_table.rs +++ b/crates/iota-storage/src/mutex_table.rs @@ -18,7 +18,7 @@ use std::{ }; use async_trait::async_trait; -use mysten_metrics::spawn_monitored_task; +use iota_metrics::spawn_monitored_task; use tokio::{ sync::{ Mutex, OwnedMutexGuard, OwnedRwLockReadGuard, OwnedRwLockWriteGuard, RwLock, TryLockError, diff --git a/crates/iota-swarm/Cargo.toml b/crates/iota-swarm/Cargo.toml index d27507ccf65..c3d2803daf5 100644 --- a/crates/iota-swarm/Cargo.toml +++ b/crates/iota-swarm/Cargo.toml @@ -19,12 +19,12 @@ tracing.workspace = true iota-config.workspace = true iota-macros.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true iota-node.workspace = true iota-protocol-config.workspace = true iota-swarm-config.workspace = true iota-types.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true telemetry-subscribers.workspace = true [target.'cfg(msim)'.dependencies] diff --git a/crates/iota-swarm/src/memory/container-sim.rs b/crates/iota-swarm/src/memory/container-sim.rs index 05efeb3216d..04d7725de1f 100644 --- a/crates/iota-swarm/src/memory/container-sim.rs +++ b/crates/iota-swarm/src/memory/container-sim.rs @@ -64,7 +64,7 @@ impl Container { let mut cancel_receiver = cancel_receiver.clone(); let startup_sender = startup_sender.clone(); async move { - let registry_service = mysten_metrics::RegistryService::new(Registry::new()); + let registry_service = iota_metrics::RegistryService::new(Registry::new()); let server = IotaNode::start(config, registry_service, None) .await .unwrap(); diff --git a/crates/iota-swarm/src/memory/container.rs b/crates/iota-swarm/src/memory/container.rs index 576112aec7b..6d1b976165d 100644 --- a/crates/iota-swarm/src/memory/container.rs +++ b/crates/iota-swarm/src/memory/container.rs @@ -98,7 +98,7 @@ impl Container { let runtime = builder.enable_all().build().unwrap(); runtime.block_on(async move { - let registry_service = mysten_metrics::start_prometheus_server(config.metrics_address); + let registry_service = iota_metrics::start_prometheus_server(config.metrics_address); info!( "Started Prometheus HTTP endpoint. To query metrics use\n\tcurl -s http://{}/metrics", config.metrics_address diff --git a/crates/iota-swarm/src/memory/node.rs b/crates/iota-swarm/src/memory/node.rs index f63c2c541b7..3236d8457f3 100644 --- a/crates/iota-swarm/src/memory/node.rs +++ b/crates/iota-swarm/src/memory/node.rs @@ -100,7 +100,7 @@ impl Node { } if is_validator { - let channel = mysten_network::client::connect(self.config.network_address()) + let channel = iota_network_stack::client::connect(self.config.network_address()) .await .map_err(|err| anyhow!(err.to_string())) .map_err(HealthCheckError::Failure) diff --git a/crates/iota-tool/src/lib.rs b/crates/iota-tool/src/lib.rs index a4451c21114..5f2cf7bdeee 100644 --- a/crates/iota-tool/src/lib.rs +++ b/crates/iota-tool/src/lib.rs @@ -43,7 +43,7 @@ use iota_core::{ execution_cache::ExecutionCache, storage::RocksDbStore, }; -use iota_network::default_mysten_network_config; +use iota_network::default_iota_network_stack_config; use iota_protocol_config::Chain; use iota_sdk::IotaClientBuilder; use iota_snapshot::{reader::StateSnapshotReaderV1, setup_db_state}; @@ -82,7 +82,7 @@ async fn make_clients( genesis: Option, fullnode_rpc: Option, ) -> Result> { - let mut net_config = default_mysten_network_config(); + let mut net_config = default_iota_network_stack_config(); net_config.connect_timeout = Some(Duration::from_secs(5)); let mut authority_clients = BTreeMap::new(); diff --git a/crates/iota-types/Cargo.toml b/crates/iota-types/Cargo.toml index d901dbc0edc..ab5cb531731 100644 --- a/crates/iota-types/Cargo.toml +++ b/crates/iota-types/Cargo.toml @@ -23,10 +23,10 @@ fastcrypto-zkp.workspace = true hex.workspace = true im.workspace = true indexmap.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true iota-stardust-sdk = { version = "1.1", default-features = false, features = ["irc_27", "irc_30", "std"], package = "iota-sdk" } itertools.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true narwhal-config.workspace = true narwhal-crypto.workspace = true num-bigint = { workspace = true, features = ["rand"] } diff --git a/crates/iota-types/src/iota_system_state/epoch_start_iota_system_state.rs b/crates/iota-types/src/iota_system_state/epoch_start_iota_system_state.rs index 16e17003d34..e8976beb48c 100644 --- a/crates/iota-types/src/iota_system_state/epoch_start_iota_system_state.rs +++ b/crates/iota-types/src/iota_system_state/epoch_start_iota_system_state.rs @@ -330,8 +330,8 @@ impl EpochStartValidatorInfoV1 { #[cfg(test)] mod test { use fastcrypto::traits::KeyPair; + use iota_network_stack::Multiaddr; use iota_protocol_config::ProtocolVersion; - use mysten_network::Multiaddr; use narwhal_crypto::NetworkKeyPair; use rand::thread_rng; diff --git a/crates/iota-types/src/iota_system_state/simtest_iota_system_state_inner.rs b/crates/iota-types/src/iota_system_state/simtest_iota_system_state_inner.rs index a0bc57bc797..ac9c296d16c 100644 --- a/crates/iota-types/src/iota_system_state/simtest_iota_system_state_inner.rs +++ b/crates/iota-types/src/iota_system_state/simtest_iota_system_state_inner.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use fastcrypto::traits::ToFromBytes; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use once_cell::sync::OnceCell; use serde::{Deserialize, Serialize}; diff --git a/crates/iota-types/src/lib.rs b/crates/iota-types/src/lib.rs index 577b335c270..2fe605680d7 100644 --- a/crates/iota-types/src/lib.rs +++ b/crates/iota-types/src/lib.rs @@ -9,6 +9,7 @@ )] use base_types::{IotaAddress, ObjectID, SequenceNumber}; +pub use iota_network_stack::multiaddr; use move_binary_format::{ binary_views::BinaryIndexedView, file_format::{AbilitySet, SignatureToken}, @@ -19,7 +20,6 @@ use move_core_types::{ language_storage::{ModuleId, StructTag}, }; pub use move_core_types::{identifier::Identifier, language_storage::TypeTag}; -pub use mysten_network::multiaddr; use object::OBJECT_START_VERSION; use crate::{ diff --git a/crates/iota-types/src/messages_checkpoint.rs b/crates/iota-types/src/messages_checkpoint.rs index f31c083fff9..7bcf25d4e77 100644 --- a/crates/iota-types/src/messages_checkpoint.rs +++ b/crates/iota-types/src/messages_checkpoint.rs @@ -45,7 +45,7 @@ use crate::{ pub type CheckpointSequenceNumber = u64; pub type CheckpointTimestamp = u64; -use mysten_metrics::histogram::Histogram; +use iota_metrics::histogram::Histogram; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct CheckpointRequest { diff --git a/crates/mysten-util-mem-derive/Cargo.toml b/crates/iota-util-mem-derive/Cargo.toml similarity index 92% rename from crates/mysten-util-mem-derive/Cargo.toml rename to crates/iota-util-mem-derive/Cargo.toml index f3c2189761b..4cc3d0ba689 100644 --- a/crates/mysten-util-mem-derive/Cargo.toml +++ b/crates/iota-util-mem-derive/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mysten-util-mem-derive" +name = "iota-util-mem-derive" version = "0.1.0" authors = ["IOTA Foundation "] edition = "2021" diff --git a/crates/mysten-util-mem-derive/lib.rs b/crates/iota-util-mem-derive/lib.rs similarity index 85% rename from crates/mysten-util-mem-derive/lib.rs rename to crates/iota-util-mem-derive/lib.rs index 1fd9edb929f..d2f308c2e52 100644 --- a/crates/mysten-util-mem-derive/lib.rs +++ b/crates/iota-util-mem-derive/lib.rs @@ -13,7 +13,7 @@ //! A crate for deriving the MallocSizeOf trait. //! //! This is a copy of Servo malloc_size_of_derive code, modified to work with -//! our `mysten_util_mem` library +//! our `iota_util_mem` library #![allow(clippy::all)] @@ -52,12 +52,12 @@ fn malloc_size_of_derive(s: synstructure::Structure) -> proc_macro2::TokenStream } else if let syn::Type::Array(..) = binding.ast().ty { Some(quote! { for item in #binding.iter() { - sum += mysten_util_mem::MallocSizeOf::size_of(item, ops); + sum += iota_util_mem::MallocSizeOf::size_of(item, ops); } }) } else { Some(quote! { - sum += mysten_util_mem::MallocSizeOf::size_of(#binding, ops); + sum += iota_util_mem::MallocSizeOf::size_of(#binding, ops); }) } }); @@ -70,14 +70,14 @@ fn malloc_size_of_derive(s: synstructure::Structure) -> proc_macro2::TokenStream let ident = ¶m.ident; where_clause .predicates - .push(parse_quote!(#ident: mysten_util_mem::MallocSizeOf)); + .push(parse_quote!(#ident: iota_util_mem::MallocSizeOf)); } let tokens = quote! { - impl #impl_generics mysten_util_mem::MallocSizeOf for #name #ty_generics #where_clause { + impl #impl_generics iota_util_mem::MallocSizeOf for #name #ty_generics #where_clause { #[inline] #[allow(unused_variables, unused_mut, unreachable_code)] - fn size_of(&self, ops: &mut mysten_util_mem::MallocSizeOfOps) -> usize { + fn size_of(&self, ops: &mut iota_util_mem::MallocSizeOfOps) -> usize { let mut sum = 0; match *self { #match_body diff --git a/crates/mysten-util-mem/Cargo.toml b/crates/iota-util-mem/Cargo.toml similarity index 93% rename from crates/mysten-util-mem/Cargo.toml rename to crates/iota-util-mem/Cargo.toml index ca9da2bcd37..5ab05788782 100644 --- a/crates/mysten-util-mem/Cargo.toml +++ b/crates/iota-util-mem/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mysten-util-mem" +name = "iota-util-mem" version = "0.11.0" authors = ["IOTA Foundation "] edition = "2021" @@ -17,8 +17,8 @@ fastcrypto-tbls.workspace = true hashbrown = { version = "0.14", optional = true } impl-trait-for-tuples = "0.2" indexmap.workspace = true +iota-util-mem-derive.workspace = true lru = { workspace = true, optional = true } -mysten-util-mem-derive.workspace = true once_cell.workspace = true parking_lot = { workspace = true, optional = true } roaring.workspace = true diff --git a/crates/mysten-util-mem/README.md b/crates/iota-util-mem/README.md similarity index 86% rename from crates/mysten-util-mem/README.md rename to crates/iota-util-mem/README.md index 914f19c80db..b1d8d0b65d8 100644 --- a/crates/mysten-util-mem/README.md +++ b/crates/iota-util-mem/README.md @@ -1,4 +1,4 @@ -# mysten-util-mem +# iota-util-mem This crate provides tools for measuring the heap memory usage of specific structures. @@ -20,10 +20,10 @@ Oftentimes, the public interface of the type you are measuring does not provide ## Measuring memory usage -To compute the heap usage of an annotated type at runtime, simply call `mysten_util_mem::malloc_size(&my_struct)`. For complete memory usage, add in the inline size of the type as well, as in: +To compute the heap usage of an annotated type at runtime, simply call `iota_util_mem::malloc_size(&my_struct)`. For complete memory usage, add in the inline size of the type as well, as in: ```rust -mysten_util_mem::malloc_size(&my_struct) + std::mem::size_of::() +iota_util_mem::malloc_size(&my_struct) + std::mem::size_of::() ``` ## Putting it all together diff --git a/crates/mysten-util-mem/src/allocators.rs b/crates/iota-util-mem/src/allocators.rs similarity index 100% rename from crates/mysten-util-mem/src/allocators.rs rename to crates/iota-util-mem/src/allocators.rs diff --git a/crates/mysten-util-mem/src/external_impls.rs b/crates/iota-util-mem/src/external_impls.rs similarity index 100% rename from crates/mysten-util-mem/src/external_impls.rs rename to crates/iota-util-mem/src/external_impls.rs diff --git a/crates/mysten-util-mem/src/lib.rs b/crates/iota-util-mem/src/lib.rs similarity index 99% rename from crates/mysten-util-mem/src/lib.rs rename to crates/iota-util-mem/src/lib.rs index 3a69e14aab8..483afdcd656 100644 --- a/crates/mysten-util-mem/src/lib.rs +++ b/crates/iota-util-mem/src/lib.rs @@ -44,11 +44,11 @@ mod malloc_size; pub mod external_impls; pub use allocators::MallocSizeOfExt; +pub use iota_util_mem_derive::*; pub use malloc_size::{ MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps, MallocUnconditionalShallowSizeOf, MallocUnconditionalSizeOf, }; -pub use mysten_util_mem_derive::*; /// Heap size of structure. /// diff --git a/crates/mysten-util-mem/src/malloc_size.rs b/crates/iota-util-mem/src/malloc_size.rs similarity index 99% rename from crates/mysten-util-mem/src/malloc_size.rs rename to crates/iota-util-mem/src/malloc_size.rs index e53909d3173..eee4a23de7a 100644 --- a/crates/mysten-util-mem/src/malloc_size.rs +++ b/crates/iota-util-mem/src/malloc_size.rs @@ -600,7 +600,7 @@ impl MallocSizeOf for parking_lot::RwLock { /// in front of type list. /// /// ```rust -/// use mysten_util_mem::{malloc_size, malloc_size_of_is_0}; +/// use iota_util_mem::{malloc_size, malloc_size_of_is_0}; /// /// struct Data

{ /// phantom: std::marker::PhantomData

, @@ -615,7 +615,7 @@ impl MallocSizeOf for parking_lot::RwLock { /// and when no "any: " /// /// ```rust -/// use mysten_util_mem::{malloc_size, malloc_size_of_is_0}; +/// use iota_util_mem::{malloc_size, malloc_size_of_is_0}; /// /// struct Data(pub T); /// diff --git a/crates/mysten-util-mem/src/memory_stats_noop.rs b/crates/iota-util-mem/src/memory_stats_noop.rs similarity index 100% rename from crates/mysten-util-mem/src/memory_stats_noop.rs rename to crates/iota-util-mem/src/memory_stats_noop.rs diff --git a/crates/mysten-util-mem/src/sizeof.rs b/crates/iota-util-mem/src/sizeof.rs similarity index 100% rename from crates/mysten-util-mem/src/sizeof.rs rename to crates/iota-util-mem/src/sizeof.rs diff --git a/crates/mysten-util-mem/tests/derive.rs b/crates/iota-util-mem/tests/derive.rs similarity index 97% rename from crates/mysten-util-mem/tests/derive.rs rename to crates/iota-util-mem/tests/derive.rs index 6aedd77d994..dc4775bfae4 100644 --- a/crates/mysten-util-mem/tests/derive.rs +++ b/crates/iota-util-mem/tests/derive.rs @@ -12,7 +12,7 @@ #![cfg(feature = "std")] -use mysten_util_mem::{MallocSizeOf, MallocSizeOfExt}; +use iota_util_mem::{MallocSizeOf, MallocSizeOfExt}; #[test] fn derive_vec() { diff --git a/narwhal/config/Cargo.toml b/narwhal/config/Cargo.toml index 256e2a19666..bc8d3bb69b8 100644 --- a/narwhal/config/Cargo.toml +++ b/narwhal/config/Cargo.toml @@ -15,8 +15,8 @@ tracing.workspace = true crypto = { path = "../crypto", package = "narwhal-crypto" } fastcrypto.workspace = true -mysten-network.workspace = true -mysten-util-mem.workspace = true +iota-network-stack.workspace = true +iota-util-mem.workspace = true rand.workspace = true [dev-dependencies] diff --git a/narwhal/config/src/committee.rs b/narwhal/config/src/committee.rs index c07a9e86167..48890839d1f 100644 --- a/narwhal/config/src/committee.rs +++ b/narwhal/config/src/committee.rs @@ -11,8 +11,8 @@ use std::{ use crypto::{NetworkPublicKey, PublicKey, PublicKeyBytes}; use fastcrypto::traits::EncodeDecodeBase64; -use mysten_network::Multiaddr; -use mysten_util_mem::MallocSizeOf; +use iota_network_stack::Multiaddr; +use iota_util_mem::MallocSizeOf; use rand::{rngs::StdRng, seq::SliceRandom, SeedableRng}; use serde::{Deserialize, Serialize}; @@ -538,7 +538,7 @@ mod tests { use crypto::{KeyPair, NetworkKeyPair, PublicKey}; use fastcrypto::traits::KeyPair as _; - use mysten_network::Multiaddr; + use iota_network_stack::Multiaddr; use rand::thread_rng; use crate::{Authority, Committee}; diff --git a/narwhal/config/src/lib.rs b/narwhal/config/src/lib.rs index 6a3fe444261..7ca57cb5860 100644 --- a/narwhal/config/src/lib.rs +++ b/narwhal/config/src/lib.rs @@ -20,7 +20,7 @@ use std::{ use crypto::{NetworkPublicKey, PublicKey}; use fastcrypto::traits::EncodeDecodeBase64; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use thiserror::Error; use tracing::info; diff --git a/narwhal/config/tests/config_tests.rs b/narwhal/config/tests/config_tests.rs index 34dabe9e42f..b426006140f 100644 --- a/narwhal/config/tests/config_tests.rs +++ b/narwhal/config/tests/config_tests.rs @@ -30,7 +30,7 @@ use config::{ }; use crypto::PublicKey; use insta::assert_json_snapshot; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use narwhal_config as config; use rand::{rngs::StdRng, seq::SliceRandom, SeedableRng}; use tempfile::tempdir; diff --git a/narwhal/executor/Cargo.toml b/narwhal/executor/Cargo.toml index e2eb18dbe64..42255cf7b0e 100644 --- a/narwhal/executor/Cargo.toml +++ b/narwhal/executor/Cargo.toml @@ -29,7 +29,7 @@ mockall.workspace = true network = { path = "../network", package = "narwhal-network" } types = { path = "../types", package = "narwhal-types" } -mysten-metrics.workspace = true +iota-metrics.workspace = true store = { path = "../../crates/typed-store", package = "typed-store" } [dev-dependencies] diff --git a/narwhal/executor/src/lib.rs b/narwhal/executor/src/lib.rs index e4b24c7aa34..4ad6fe72f82 100644 --- a/narwhal/executor/src/lib.rs +++ b/narwhal/executor/src/lib.rs @@ -12,9 +12,9 @@ use std::sync::Arc; use async_trait::async_trait; use config::{AuthorityIdentifier, Committee, WorkerCache}; pub use errors::{SubscriberError, SubscriberResult}; +use iota_metrics::metered_channel; use iota_protocol_config::ProtocolConfig; use mockall::automock; -use mysten_metrics::metered_channel; use network::client::NetworkClient; use prometheus::Registry; pub use state::ExecutionIndices; diff --git a/narwhal/executor/src/subscriber.rs b/narwhal/executor/src/subscriber.rs index 8c70af30823..270fa5ba65d 100644 --- a/narwhal/executor/src/subscriber.rs +++ b/narwhal/executor/src/subscriber.rs @@ -13,8 +13,8 @@ use config::{AuthorityIdentifier, Committee, WorkerCache, WorkerId}; use crypto::NetworkPublicKey; use fastcrypto::hash::Hash; use futures::{stream::FuturesOrdered, StreamExt}; +use iota_metrics::{metered_channel, spawn_logged_monitored_task}; use iota_protocol_config::ProtocolConfig; -use mysten_metrics::{metered_channel, spawn_logged_monitored_task}; use network::{client::NetworkClient, PrimaryToWorkerClient}; use tokio::task::JoinHandle; use tracing::{debug, error, info}; diff --git a/narwhal/network/Cargo.toml b/narwhal/network/Cargo.toml index ff8bc820dae..cf577ddd9ad 100644 --- a/narwhal/network/Cargo.toml +++ b/narwhal/network/Cargo.toml @@ -18,9 +18,9 @@ bytes.workspace = true crypto = { path = "../crypto", package = "narwhal-crypto" } dashmap.workspace = true futures.workspace = true +iota-common.workspace = true iota-macros.workspace = true -mysten-common.workspace = true -mysten-metrics.workspace = true +iota-metrics.workspace = true parking_lot.workspace = true prometheus.workspace = true quinn-proto.workspace = true diff --git a/narwhal/network/src/admin.rs b/narwhal/network/src/admin.rs index c2bf95ea7b4..40e01b76609 100644 --- a/narwhal/network/src/admin.rs +++ b/narwhal/network/src/admin.rs @@ -8,7 +8,7 @@ use std::{ }; use axum::{extract::Extension, http::StatusCode, routing::get, Json, Router}; -use mysten_metrics::{spawn_logged_monitored_task, spawn_monitored_task}; +use iota_metrics::{spawn_logged_monitored_task, spawn_monitored_task}; use tokio::{task::JoinHandle, time::sleep}; use tracing::{error, info}; use types::ConditionalBroadcastReceiver; diff --git a/narwhal/network/src/client.rs b/narwhal/network/src/client.rs index 48fc6f480d1..f845b817db3 100644 --- a/narwhal/network/src/client.rs +++ b/narwhal/network/src/client.rs @@ -7,7 +7,7 @@ use std::{collections::BTreeMap, sync::Arc, time::Duration}; use anemo::{Network, PeerId, Request}; use async_trait::async_trait; use crypto::{traits::KeyPair, NetworkKeyPair, NetworkPublicKey}; -use mysten_common::sync::notify_once::NotifyOnce; +use iota_common::sync::notify_once::NotifyOnce; use parking_lot::RwLock; use tokio::{select, time::sleep}; use tracing::error; diff --git a/narwhal/network/src/connectivity.rs b/narwhal/network/src/connectivity.rs index dad670d78ab..0639311489c 100644 --- a/narwhal/network/src/connectivity.rs +++ b/narwhal/network/src/connectivity.rs @@ -7,7 +7,7 @@ use std::{collections::HashMap, sync::Arc, time::Duration}; use anemo::{types::PeerEvent, PeerId}; use dashmap::DashMap; use futures::future; -use mysten_metrics::spawn_logged_monitored_task; +use iota_metrics::spawn_logged_monitored_task; use quinn_proto::ConnectionStats; use tokio::{task::JoinHandle, time}; use types::ConditionalBroadcastReceiver; diff --git a/narwhal/node/Cargo.toml b/narwhal/node/Cargo.toml index 2f549c295fa..b6fcdfe8d0b 100644 --- a/narwhal/node/Cargo.toml +++ b/narwhal/node/Cargo.toml @@ -38,8 +38,8 @@ storage = { path = "../storage", package = "narwhal-storage" } types = { path = "../types", package = "narwhal-types" } worker = { path = "../worker", package = "narwhal-worker" } -mysten-metrics.workspace = true -mysten-network.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true telemetry-subscribers.workspace = true anemo.workspace = true diff --git a/narwhal/node/src/benchmark_client.rs b/narwhal/node/src/benchmark_client.rs index 119ffb62299..e15c48abcc2 100644 --- a/narwhal/node/src/benchmark_client.rs +++ b/narwhal/node/src/benchmark_client.rs @@ -9,7 +9,7 @@ use bytes::Bytes; use clap::*; use eyre::Context; use futures::future::join_all; -use mysten_network::Multiaddr; +use iota_network_stack::Multiaddr; use narwhal_node::metrics::NarwhalBenchMetrics; use prometheus::Registry; use rand::{ @@ -106,13 +106,13 @@ async fn main() -> Result<(), eyre::Report> { set_global_default(subscriber).expect("Failed to set subscriber"); - let registry_service = mysten_metrics::start_prometheus_server( + let registry_service = iota_metrics::start_prometheus_server( format!("{}:{}", app.client_metric_host, app.client_metric_port) .parse() .unwrap(), ); let registry: Registry = registry_service.default_registry(); - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); let metrics = NarwhalBenchMetrics::new(®istry); let target = app.addr; diff --git a/narwhal/node/src/generate_format.rs b/narwhal/node/src/generate_format.rs index 61acd36b281..0d7dc832eeb 100644 --- a/narwhal/node/src/generate_format.rs +++ b/narwhal/node/src/generate_format.rs @@ -11,8 +11,8 @@ use fastcrypto::{ hash::Hash, traits::{KeyPair as _, Signer}, }; +use iota_network_stack::Multiaddr; use move_bytecode_utils::layout::YamlRegistry; -use mysten_network::Multiaddr; use rand::{prelude::StdRng, SeedableRng}; use serde_reflection::{Result, Samples, Tracer, TracerConfig}; use types::{ diff --git a/narwhal/node/src/main.rs b/narwhal/node/src/main.rs index 8c31cf9a785..dfccf603b56 100644 --- a/narwhal/node/src/main.rs +++ b/narwhal/node/src/main.rs @@ -30,6 +30,7 @@ use iota_keys::keypair_file::{ read_authority_keypair_from_file, read_network_keypair_from_file, write_authority_keypair_to_file, write_keypair_to_file, }; +use iota_metrics::start_prometheus_server; use iota_protocol_config::{Chain, ProtocolConfig, ProtocolVersion}; use iota_types::{ crypto::{ @@ -37,7 +38,6 @@ use iota_types::{ }, multiaddr::Multiaddr, }; -use mysten_metrics::start_prometheus_server; use narwhal_node as node; use narwhal_node::{ metrics::NarwhalBenchMetrics, primary_node::PrimaryNode, worker_node::WorkerNode, @@ -662,7 +662,7 @@ async fn run( .await?; let registry: Registry = registry_service.default_registry(); - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); let metrics = NarwhalBenchMetrics::new(®istry); let target = addr; @@ -698,12 +698,12 @@ async fn run( }; if let Some(registry) = worker_registry { - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); registry_service.add(registry); } if let Some(registry) = primary_registry { - mysten_metrics::init_metrics(®istry); + iota_metrics::init_metrics(®istry); registry_service.add(registry); } diff --git a/narwhal/node/src/metrics.rs b/narwhal/node/src/metrics.rs index 674247c276b..e3ee594494b 100644 --- a/narwhal/node/src/metrics.rs +++ b/narwhal/node/src/metrics.rs @@ -6,8 +6,8 @@ use std::collections::HashMap; use axum::{routing::get, Extension, Router}; use config::{AuthorityIdentifier, WorkerId}; -use mysten_metrics::{metrics, spawn_logged_monitored_task}; -use mysten_network::multiaddr::Multiaddr; +use iota_metrics::{metrics, spawn_logged_monitored_task}; +use iota_network_stack::multiaddr::Multiaddr; use prometheus::{ register_counter_with_registry, register_histogram_with_registry, register_int_counter_with_registry, register_int_gauge_with_registry, Counter, Histogram, diff --git a/narwhal/node/src/primary_node.rs b/narwhal/node/src/primary_node.rs index 3953d54f364..59e67372cc8 100644 --- a/narwhal/node/src/primary_node.rs +++ b/narwhal/node/src/primary_node.rs @@ -9,8 +9,8 @@ use config::{AuthorityIdentifier, Committee, Parameters, WorkerCache}; use crypto::{KeyPair, NetworkKeyPair, PublicKey}; use executor::{get_restored_consensus_output, ExecutionState, Executor, SubscriberResult}; use fastcrypto::traits::{KeyPair as _, VerifyingKey}; +use iota_metrics::{metered_channel, RegistryID, RegistryService}; use iota_protocol_config::ProtocolConfig; -use mysten_metrics::{metered_channel, RegistryID, RegistryService}; use network::client::NetworkClient; use primary::{ consensus::{ diff --git a/narwhal/node/src/worker_node.rs b/narwhal/node/src/worker_node.rs index 4927145d7db..a72ba0e3c45 100644 --- a/narwhal/node/src/worker_node.rs +++ b/narwhal/node/src/worker_node.rs @@ -9,7 +9,7 @@ use arc_swap::{ArcSwap, ArcSwapOption}; use config::{Committee, Parameters, WorkerCache, WorkerId}; use crypto::{NetworkKeyPair, PublicKey}; use fastcrypto::traits::KeyPair; -use mysten_metrics::{RegistryID, RegistryService}; +use iota_metrics::{RegistryID, RegistryService}; use network::client::NetworkClient; use prometheus::Registry; use storage::NodeStorage; diff --git a/narwhal/node/tests/node_test.rs b/narwhal/node/tests/node_test.rs index cb2b37c99b3..195630987a2 100644 --- a/narwhal/node/tests/node_test.rs +++ b/narwhal/node/tests/node_test.rs @@ -6,7 +6,7 @@ use std::{num::NonZeroUsize, time::Duration}; use config::Parameters; use fastcrypto::traits::KeyPair; -use mysten_metrics::RegistryService; +use iota_metrics::RegistryService; use narwhal_node::{ execution_state::SimpleExecutionState, primary_node::PrimaryNode, worker_node::WorkerNodes, }; diff --git a/narwhal/primary/Cargo.toml b/narwhal/primary/Cargo.toml index d0578ccfc02..a79786d5fc5 100644 --- a/narwhal/primary/Cargo.toml +++ b/narwhal/primary/Cargo.toml @@ -31,15 +31,15 @@ tracing.workspace = true crypto = { path = "../crypto", package = "narwhal-crypto" } fastcrypto.workspace = true iota-macros.workspace = true +iota-network-stack.workspace = true iota-protocol-config.workspace = true -mysten-network.workspace = true network = { path = "../network", package = "narwhal-network" } storage = { path = "../storage", package = "narwhal-storage" } store = { path = "../../crates/typed-store", package = "typed-store" } types = { path = "../types", package = "narwhal-types" } -mysten-common.workspace = true -mysten-metrics.workspace = true +iota-common.workspace = true +iota-metrics.workspace = true anemo.workspace = true anemo-tower.workspace = true diff --git a/narwhal/primary/src/certificate_fetcher.rs b/narwhal/primary/src/certificate_fetcher.rs index bdeb3c040cf..390359ebfdb 100644 --- a/narwhal/primary/src/certificate_fetcher.rs +++ b/narwhal/primary/src/certificate_fetcher.rs @@ -13,7 +13,7 @@ use anemo::Request; use config::{AuthorityIdentifier, Committee}; use crypto::NetworkPublicKey; use futures::{stream::FuturesUnordered, StreamExt}; -use mysten_metrics::{ +use iota_metrics::{ metered_channel::Receiver, monitored_future, monitored_scope, spawn_logged_monitored_task, }; use network::PrimaryToPrimaryRpc; diff --git a/narwhal/primary/src/certifier.rs b/narwhal/primary/src/certifier.rs index cb7bb252e74..32d34444e0b 100644 --- a/narwhal/primary/src/certifier.rs +++ b/narwhal/primary/src/certifier.rs @@ -10,9 +10,9 @@ use crypto::{NetworkPublicKey, Signature}; use fastcrypto::signature_service::SignatureService; use futures::{stream::FuturesUnordered, StreamExt}; use iota_macros::fail_point_async; +use iota_metrics::{metered_channel::Receiver, monitored_future, spawn_logged_monitored_task}; +use iota_network_stack::anemo_ext::NetworkExt; use iota_protocol_config::ProtocolConfig; -use mysten_metrics::{metered_channel::Receiver, monitored_future, spawn_logged_monitored_task}; -use mysten_network::anemo_ext::NetworkExt; use storage::CertificateStore; use tokio::{ sync::oneshot, diff --git a/narwhal/primary/src/consensus/metrics.rs b/narwhal/primary/src/consensus/metrics.rs index c1b32c7ef1f..66911e16a33 100644 --- a/narwhal/primary/src/consensus/metrics.rs +++ b/narwhal/primary/src/consensus/metrics.rs @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use mysten_metrics::histogram::Histogram as MystenHistogram; +use iota_metrics::histogram::Histogram as MystenHistogram; use prometheus::{ default_registry, register_histogram_with_registry, register_int_counter_vec_with_registry, register_int_counter_with_registry, register_int_gauge_vec_with_registry, diff --git a/narwhal/primary/src/consensus/state.rs b/narwhal/primary/src/consensus/state.rs index e410cd64270..b6a63b298b4 100644 --- a/narwhal/primary/src/consensus/state.rs +++ b/narwhal/primary/src/consensus/state.rs @@ -14,7 +14,7 @@ use std::{ use config::{AuthorityIdentifier, Committee}; use fastcrypto::hash::Hash; -use mysten_metrics::{metered_channel, spawn_logged_monitored_task}; +use iota_metrics::{metered_channel, spawn_logged_monitored_task}; use storage::{CertificateStore, ConsensusStore}; use tokio::{sync::watch, task::JoinHandle}; use tracing::{debug, info, instrument}; diff --git a/narwhal/primary/src/primary.rs b/narwhal/primary/src/primary.rs index 0857976a9a5..315ed0584b0 100644 --- a/narwhal/primary/src/primary.rs +++ b/narwhal/primary/src/primary.rs @@ -32,12 +32,12 @@ use fastcrypto::{ signature_service::SignatureService, traits::{KeyPair as _, ToFromBytes}, }; -use iota_protocol_config::ProtocolConfig; -use mysten_metrics::{ +use iota_metrics::{ metered_channel::{channel_with_total, Receiver, Sender}, monitored_scope, }; -use mysten_network::{multiaddr::Protocol, Multiaddr}; +use iota_network_stack::{multiaddr::Protocol, Multiaddr}; +use iota_protocol_config::ProtocolConfig; use network::{ client::NetworkClient, epoch_filter::{AllowedEpoch, EPOCH_HEADER_KEY}, diff --git a/narwhal/primary/src/proposer.rs b/narwhal/primary/src/proposer.rs index a199cb529a6..14f878ab829 100644 --- a/narwhal/primary/src/proposer.rs +++ b/narwhal/primary/src/proposer.rs @@ -11,7 +11,7 @@ use std::{ use config::{AuthorityIdentifier, Committee, WorkerId}; use fastcrypto::hash::Hash as _; -use mysten_metrics::{ +use iota_metrics::{ metered_channel::{Receiver, Sender}, spawn_logged_monitored_task, }; diff --git a/narwhal/primary/src/state_handler.rs b/narwhal/primary/src/state_handler.rs index afb77230295..e341ad4a55e 100644 --- a/narwhal/primary/src/state_handler.rs +++ b/narwhal/primary/src/state_handler.rs @@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 use config::AuthorityIdentifier; -use mysten_metrics::{ +use iota_metrics::{ metered_channel::{Receiver, Sender}, spawn_logged_monitored_task, }; diff --git a/narwhal/primary/src/synchronizer.rs b/narwhal/primary/src/synchronizer.rs index b1cb72d4334..2b3dc953e93 100644 --- a/narwhal/primary/src/synchronizer.rs +++ b/narwhal/primary/src/synchronizer.rs @@ -18,14 +18,14 @@ use config::{AuthorityIdentifier, Committee, WorkerCache}; use crypto::NetworkPublicKey; use fastcrypto::hash::Hash as _; use futures::{stream::FuturesOrdered, StreamExt}; -use iota_protocol_config::ProtocolConfig; -use itertools::Itertools; -use mysten_common::sync::notify_once::NotifyOnce; -use mysten_metrics::{ +use iota_common::sync::notify_once::NotifyOnce; +use iota_metrics::{ metered_channel::{channel_with_total, Sender}, monitored_scope, spawn_logged_monitored_task, }; -use mysten_network::anemo_ext::{NetworkExt, WaitingPeer}; +use iota_network_stack::anemo_ext::{NetworkExt, WaitingPeer}; +use iota_protocol_config::ProtocolConfig; +use itertools::Itertools; use network::{client::NetworkClient, PrimaryToWorkerClient, RetryConfig}; use parking_lot::Mutex; use storage::{CertificateStore, PayloadStore}; diff --git a/narwhal/primary/src/tests/primary_tests.rs b/narwhal/primary/src/tests/primary_tests.rs index 4c23220f527..c37609ee41d 100644 --- a/narwhal/primary/src/tests/primary_tests.rs +++ b/narwhal/primary/src/tests/primary_tests.rs @@ -59,7 +59,7 @@ async fn test_get_network_peers_from_admin_server() { let store = NodeStorage::reopen(temp_dir(), None); let client_1 = NetworkClient::new_from_keypair(&authority_1.network_keypair()); - let (tx_new_certificates, _rx_new_certificates) = mysten_metrics::metered_channel::channel( + let (tx_new_certificates, _rx_new_certificates) = iota_metrics::metered_channel::channel( CHANNEL_CAPACITY, &prometheus::IntGauge::new( PrimaryChannelMetrics::NAME_NEW_CERTS, @@ -67,7 +67,7 @@ async fn test_get_network_peers_from_admin_server() { ) .unwrap(), ); - let (tx_feedback, rx_feedback) = mysten_metrics::metered_channel::channel( + let (tx_feedback, rx_feedback) = iota_metrics::metered_channel::channel( CHANNEL_CAPACITY, &prometheus::IntGauge::new( PrimaryChannelMetrics::NAME_COMMITTED_CERTS, @@ -174,7 +174,7 @@ async fn test_get_network_peers_from_admin_server() { }; // TODO: Rework test-utils so that macro can be used for the channels below. - let (tx_new_certificates_2, _rx_new_certificates_2) = mysten_metrics::metered_channel::channel( + let (tx_new_certificates_2, _rx_new_certificates_2) = iota_metrics::metered_channel::channel( CHANNEL_CAPACITY, &prometheus::IntGauge::new( PrimaryChannelMetrics::NAME_NEW_CERTS, @@ -182,7 +182,7 @@ async fn test_get_network_peers_from_admin_server() { ) .unwrap(), ); - let (tx_feedback_2, rx_feedback_2) = mysten_metrics::metered_channel::channel( + let (tx_feedback_2, rx_feedback_2) = iota_metrics::metered_channel::channel( CHANNEL_CAPACITY, &prometheus::IntGauge::new( PrimaryChannelMetrics::NAME_COMMITTED_CERTS, diff --git a/narwhal/storage/Cargo.toml b/narwhal/storage/Cargo.toml index b260eb4ba76..ee8a91ee2ce 100644 --- a/narwhal/storage/Cargo.toml +++ b/narwhal/storage/Cargo.toml @@ -11,9 +11,9 @@ config = { path = "../config", package = "narwhal-config" } fastcrypto.workspace = true fastcrypto-tbls.workspace = true futures.workspace = true +iota-common.workspace = true iota-macros.workspace = true lru.workspace = true -mysten-common.workspace = true parking_lot.workspace = true prometheus.workspace = true store = { path = "../../crates/typed-store", package = "typed-store" } diff --git a/narwhal/storage/src/certificate_store.rs b/narwhal/storage/src/certificate_store.rs index 14dbf28bd2e..5a86e05d771 100644 --- a/narwhal/storage/src/certificate_store.rs +++ b/narwhal/storage/src/certificate_store.rs @@ -12,9 +12,9 @@ use std::{ use config::AuthorityIdentifier; use fastcrypto::hash::Hash; +use iota_common::sync::notify_read::NotifyRead; use iota_macros::fail_point; use lru::LruCache; -use mysten_common::sync::notify_read::NotifyRead; use parking_lot::Mutex; use prometheus::{register_int_counter_with_registry, IntCounter, Registry}; use store::{rocks::DBMap, Map, TypedStoreError::RocksDBError}; diff --git a/narwhal/storage/src/payload_store.rs b/narwhal/storage/src/payload_store.rs index a8efb7e6bfd..db4f9350f97 100644 --- a/narwhal/storage/src/payload_store.rs +++ b/narwhal/storage/src/payload_store.rs @@ -5,8 +5,8 @@ use std::sync::Arc; use config::WorkerId; +use iota_common::sync::notify_read::NotifyRead; use iota_macros::fail_point; -use mysten_common::sync::notify_read::NotifyRead; use store::{ reopen, rocks::{open_cf, DBMap, MetricConf, ReadWriteOptions}, diff --git a/narwhal/test-utils/Cargo.toml b/narwhal/test-utils/Cargo.toml index f90cd01c827..8550d063516 100644 --- a/narwhal/test-utils/Cargo.toml +++ b/narwhal/test-utils/Cargo.toml @@ -22,9 +22,9 @@ config = { path = "../config", package = "narwhal-config" } crypto = { path = "../crypto", package = "narwhal-crypto" } executor = { path = "../executor", package = "narwhal-executor" } fastcrypto.workspace = true +iota-metrics.workspace = true +iota-network-stack.workspace = true iota-protocol-config.workspace = true -mysten-metrics.workspace = true -mysten-network.workspace = true network = { path = "../network", package = "narwhal-network" } node = { path = "../node", package = "narwhal-node" } primary = { path = "../primary", package = "narwhal-primary" } diff --git a/narwhal/test-utils/src/cluster.rs b/narwhal/test-utils/src/cluster.rs index 5d99305cca6..445106efb49 100644 --- a/narwhal/test-utils/src/cluster.rs +++ b/narwhal/test-utils/src/cluster.rs @@ -8,9 +8,9 @@ use config::{AuthorityIdentifier, Committee, Parameters, WorkerCache, WorkerId}; use crypto::{KeyPair, NetworkKeyPair, PublicKey}; use executor::SerializedTransaction; use fastcrypto::traits::KeyPair as _; +use iota_metrics::RegistryService; +use iota_network_stack::multiaddr::Multiaddr; use itertools::Itertools; -use mysten_metrics::RegistryService; -use mysten_network::multiaddr::Multiaddr; use network::client::NetworkClient; use node::{ execution_state::SimpleExecutionState, metrics::worker_metrics_registry, @@ -753,7 +753,7 @@ impl AuthorityDetails { ) -> TransactionsClient { let internal = self.internal.read().await; - let config = mysten_network::config::Config::new(); + let config = iota_network_stack::config::Config::new(); let channel = config .connect_lazy( &internal diff --git a/narwhal/test-utils/src/lib.rs b/narwhal/test-utils/src/lib.rs index d8f599557bf..a1ffaf7fc16 100644 --- a/narwhal/test-utils/src/lib.rs +++ b/narwhal/test-utils/src/lib.rs @@ -23,8 +23,8 @@ use fastcrypto::{ traits::{AllowedRng, KeyPair as _}, }; use indexmap::IndexMap; +use iota_network_stack::Multiaddr; use iota_protocol_config::{Chain, ProtocolConfig, ProtocolVersion}; -use mysten_network::Multiaddr; use once_cell::sync::OnceCell; use rand::{ distributions::{Bernoulli, Distribution}, @@ -78,7 +78,7 @@ pub fn ensure_test_environment() { #[macro_export] macro_rules! test_channel { ($e:expr) => { - mysten_metrics::metered_channel::channel( + iota_metrics::metered_channel::channel( $e, &prometheus::IntGauge::new("TEST_COUNTER", "test counter").unwrap(), ); @@ -100,7 +100,7 @@ macro_rules! test_channel { #[macro_export] macro_rules! test_committed_certificates_channel { ($e:expr) => { - mysten_metrics::metered_channel::channel( + iota_metrics::metered_channel::channel( $e, &prometheus::IntGauge::new( primary::PrimaryChannelMetrics::NAME_COMMITTED_CERTS, @@ -114,7 +114,7 @@ macro_rules! test_committed_certificates_channel { #[macro_export] macro_rules! test_new_certificates_channel { ($e:expr) => { - mysten_metrics::metered_channel::channel( + iota_metrics::metered_channel::channel( $e, &prometheus::IntGauge::new( primary::PrimaryChannelMetrics::NAME_NEW_CERTS, diff --git a/narwhal/types/Cargo.toml b/narwhal/types/Cargo.toml index 365a67891ef..0057dc832c1 100644 --- a/narwhal/types/Cargo.toml +++ b/narwhal/types/Cargo.toml @@ -35,9 +35,9 @@ crypto = { path = "../crypto", package = "narwhal-crypto" } fastcrypto.workspace = true once_cell.workspace = true -mysten-common.workspace = true -mysten-network.workspace = true -mysten-util-mem.workspace = true +iota-common.workspace = true +iota-network-stack.workspace = true +iota-util-mem.workspace = true store = { path = "../../crates/typed-store", package = "typed-store" } [dev-dependencies] @@ -45,7 +45,7 @@ criterion.workspace = true serde_test = "1.0" test-utils = { path = "../test-utils", package = "narwhal-test-utils" } -mysten-metrics.workspace = true +iota-metrics.workspace = true [target.'cfg(not(target_env = "msvc"))'.build-dependencies] protobuf-src = "1.1" diff --git a/narwhal/types/build.rs b/narwhal/types/build.rs index 179ae2b58b5..f777b02c3ac 100644 --- a/narwhal/types/build.rs +++ b/narwhal/types/build.rs @@ -47,7 +47,7 @@ fn build_anemo_services(out_dir: &Path) { let mut automock_attribute = anemo_build::Attributes::default(); automock_attribute.push_trait(".", r#"#[mockall::automock]"#); - let codec_path = "mysten_network::codec::anemo::BcsSnappyCodec"; + let codec_path = "iota_network_stack::codec::anemo::BcsSnappyCodec"; let primary_to_primary = anemo_build::manual::Service::builder() .name("PrimaryToPrimary") diff --git a/narwhal/types/src/error.rs b/narwhal/types/src/error.rs index fa6486b8185..0b5fc13ad47 100644 --- a/narwhal/types/src/error.rs +++ b/narwhal/types/src/error.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use anemo::PeerId; use config::Epoch; use fastcrypto::hash::Digest; -use mysten_common::sync::notify_once::NotifyOnce; +use iota_common::sync::notify_once::NotifyOnce; use store::StoreError; use thiserror::Error; diff --git a/narwhal/types/src/primary.rs b/narwhal/types/src/primary.rs index c407af8422b..17663ab4073 100644 --- a/narwhal/types/src/primary.rs +++ b/narwhal/types/src/primary.rs @@ -23,7 +23,7 @@ use fastcrypto::{ traits::{AggregateAuthenticator, Signer, VerifyingKey}, }; use indexmap::IndexMap; -use mysten_util_mem::MallocSizeOf; +use iota_util_mem::MallocSizeOf; use once_cell::sync::OnceCell; use proptest_derive::Arbitrary; use roaring::RoaringBitmap; diff --git a/narwhal/types/src/tests/error_test.rs b/narwhal/types/src/tests/error_test.rs index 83447f0fd29..9b19b4d5ec6 100644 --- a/narwhal/types/src/tests/error_test.rs +++ b/narwhal/types/src/tests/error_test.rs @@ -5,7 +5,7 @@ use std::{future, time::Duration}; use futures::{stream::FuturesUnordered, StreamExt}; -use mysten_metrics::metered_channel::{channel, Receiver, Sender, WithPermit}; +use iota_metrics::metered_channel::{channel, Receiver, Sender, WithPermit}; use prometheus::IntGauge; use super::DagError; diff --git a/narwhal/worker/Cargo.toml b/narwhal/worker/Cargo.toml index 9f0702699b6..0ce24bac3d1 100644 --- a/narwhal/worker/Cargo.toml +++ b/narwhal/worker/Cargo.toml @@ -25,8 +25,8 @@ tracing.workspace = true config = { path = "../config", package = "narwhal-config" } crypto = { path = "../crypto", package = "narwhal-crypto" } fastcrypto.workspace = true -mysten-metrics = { path = "../../crates/mysten-metrics" } -mysten-network = { path = "../../crates/mysten-network" } +iota-metrics = { path = "../../crates/iota-metrics" } +iota-network-stack = { path = "../../crates/iota-network-stack" } network = { path = "../network", package = "narwhal-network" } prometheus.workspace = true store = { path = "../../crates/typed-store", package = "typed-store" } diff --git a/narwhal/worker/src/batch_maker.rs b/narwhal/worker/src/batch_maker.rs index 1431cfe48f7..701ef6637d0 100644 --- a/narwhal/worker/src/batch_maker.rs +++ b/narwhal/worker/src/batch_maker.rs @@ -12,7 +12,7 @@ use byteorder::{BigEndian, ReadBytesExt}; use config::WorkerId; use fastcrypto::hash::Hash; use futures::{future::BoxFuture, stream::FuturesUnordered, StreamExt}; -use mysten_metrics::{ +use iota_metrics::{ metered_channel::{Receiver, Sender}, monitored_scope, spawn_logged_monitored_task, }; diff --git a/narwhal/worker/src/client.rs b/narwhal/worker/src/client.rs index 23e804a9a2a..0417e6d04c0 100644 --- a/narwhal/worker/src/client.rs +++ b/narwhal/worker/src/client.rs @@ -9,8 +9,8 @@ use std::{ }; use arc_swap::{ArcSwap, ArcSwapOption}; -use mysten_metrics::metered_channel::Sender; -use mysten_network::{multiaddr::Protocol, Multiaddr}; +use iota_metrics::metered_channel::Sender; +use iota_network_stack::{multiaddr::Protocol, Multiaddr}; use thiserror::Error; use tokio::time::{sleep, timeout, Duration}; use tracing::info; diff --git a/narwhal/worker/src/metrics.rs b/narwhal/worker/src/metrics.rs index ff6e49aa02d..2fcb4372337 100644 --- a/narwhal/worker/src/metrics.rs +++ b/narwhal/worker/src/metrics.rs @@ -4,7 +4,7 @@ use std::time::Duration; -use mysten_network::metrics::MetricsCallbackProvider; +use iota_network_stack::metrics::MetricsCallbackProvider; use network::metrics::{NetworkConnectionMetrics, NetworkMetrics}; use prometheus::{ default_registry, register_histogram_vec_with_registry, register_histogram_with_registry, diff --git a/narwhal/worker/src/quorum_waiter.rs b/narwhal/worker/src/quorum_waiter.rs index 149d40de390..15c3dca5d7e 100644 --- a/narwhal/worker/src/quorum_waiter.rs +++ b/narwhal/worker/src/quorum_waiter.rs @@ -8,7 +8,7 @@ use std::{sync::Arc, time::Duration}; use config::{Authority, Committee, Stake, WorkerCache, WorkerId}; use fastcrypto::hash::Hash; use futures::stream::{futures_unordered::FuturesUnordered, StreamExt as _}; -use mysten_metrics::{metered_channel::Receiver, monitored_future, spawn_logged_monitored_task}; +use iota_metrics::{metered_channel::Receiver, monitored_future, spawn_logged_monitored_task}; use network::{CancelOnDropHandler, ReliableNetwork}; use tokio::{task::JoinHandle, time::timeout}; use tracing::{trace, warn}; diff --git a/narwhal/worker/src/tests/worker_tests.rs b/narwhal/worker/src/tests/worker_tests.rs index 809f6423839..81261926c81 100644 --- a/narwhal/worker/src/tests/worker_tests.rs +++ b/narwhal/worker/src/tests/worker_tests.rs @@ -103,7 +103,7 @@ async fn reject_invalid_clients_transactions() { .worker(&public_key, &worker_id) .unwrap() .transactions; - let config = mysten_network::config::Config::new(); + let config = iota_network_stack::config::Config::new(); let channel = config.connect_lazy(&address).unwrap(); let mut client = TransactionsClient::new(channel); let tx = transaction(); @@ -232,7 +232,7 @@ async fn handle_remote_clients_transactions() { .worker(&authority_public_key, &worker_id) .unwrap() .transactions; - let config = mysten_network::config::Config::new(); + let config = iota_network_stack::config::Config::new(); let channel = config.connect_lazy(&address).unwrap(); let client = TransactionsClient::new(channel); diff --git a/narwhal/worker/src/transactions_server.rs b/narwhal/worker/src/transactions_server.rs index 6450e73cc60..27240d3602d 100644 --- a/narwhal/worker/src/transactions_server.rs +++ b/narwhal/worker/src/transactions_server.rs @@ -6,8 +6,8 @@ use std::{sync::Arc, time::Duration}; use async_trait::async_trait; use futures::{stream::FuturesUnordered, StreamExt}; -use mysten_metrics::{metered_channel::Sender, monitored_scope, spawn_logged_monitored_task}; -use mysten_network::{server::Server, Multiaddr}; +use iota_metrics::{metered_channel::Sender, monitored_scope, spawn_logged_monitored_task}; +use iota_network_stack::{server::Server, Multiaddr}; use tokio::{ task::JoinHandle, time::{sleep, timeout}, @@ -71,7 +71,7 @@ impl TxServer { let mut server: Server; loop { - match mysten_network::config::Config::new() + match iota_network_stack::config::Config::new() .server_builder_with_metrics(self.endpoint_metrics.clone()) .add_service(TransactionsServer::new(tx_handler.clone())) .bind(&self.address) diff --git a/narwhal/worker/src/worker.rs b/narwhal/worker/src/worker.rs index 64de9aea219..446fa4c84bc 100644 --- a/narwhal/worker/src/worker.rs +++ b/narwhal/worker/src/worker.rs @@ -19,8 +19,8 @@ use anemo_tower::{ }; use config::{Authority, AuthorityIdentifier, Committee, Parameters, WorkerCache, WorkerId}; use crypto::{traits::KeyPair as _, NetworkKeyPair, NetworkPublicKey}; -use mysten_metrics::{metered_channel::channel_with_total, spawn_logged_monitored_task}; -use mysten_network::{multiaddr::Protocol, Multiaddr}; +use iota_metrics::{metered_channel::channel_with_total, spawn_logged_monitored_task}; +use iota_network_stack::{multiaddr::Protocol, Multiaddr}; use network::{ client::NetworkClient, epoch_filter::{AllowedEpoch, EPOCH_HEADER_KEY},