From 3e77eed9a9c6f387b82fee1112c4e4e70dc9d81e Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 6 Jun 2024 13:16:24 -0500 Subject: [PATCH 1/2] config: remove unused 'enable_event_processing' field --- crates/sui-config/src/node.rs | 4 ---- crates/sui-swarm-config/src/node_config_builder.rs | 2 -- 2 files changed, 6 deletions(-) diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 5aa6e0aa7e632..0457473f192ee 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -73,10 +73,6 @@ pub struct NodeConfig { #[serde(skip_serializing_if = "Option::is_none")] pub consensus_config: Option, - // TODO: Remove this as it's no longer used. - #[serde(default)] - pub enable_event_processing: bool, - #[serde(default = "default_enable_index_processing")] pub enable_index_processing: bool, diff --git a/crates/sui-swarm-config/src/node_config_builder.rs b/crates/sui-swarm-config/src/node_config_builder.rs index a283a5aecc773..daec39aaa7403 100644 --- a/crates/sui-swarm-config/src/node_config_builder.rs +++ b/crates/sui-swarm-config/src/node_config_builder.rs @@ -197,7 +197,6 @@ impl ValidatorConfigBuilder { .to_socket_addr() .unwrap(), consensus_config: Some(consensus_config), - enable_event_processing: false, enable_index_processing: default_enable_index_processing(), genesis: sui_config::node::Genesis::new(genesis), grpc_load_shed: None, @@ -465,7 +464,6 @@ impl FullnodeConfigBuilder { .unwrap_or(local_ip_utils::get_available_port(&localhost)), json_rpc_address: self.json_rpc_address.unwrap_or(json_rpc_address), consensus_config: None, - enable_event_processing: true, // This is unused. enable_index_processing: default_enable_index_processing(), genesis: self.genesis.unwrap_or(sui_config::node::Genesis::new( network_config.genesis.clone(), From f5bea1deb013340f83ad72715e15260d87c6dff9 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 6 Jun 2024 13:35:55 -0500 Subject: [PATCH 2/2] config: allow configuring jsonrpc server type Allow for configuring the jsonrpc server type as well as setting the default to be an HTTP only based service. --- Cargo.lock | 1 + crates/sui-config/src/node.rs | 19 ++- crates/sui-e2e-tests/tests/full_node_tests.rs | 114 +----------------- crates/sui-indexer/src/lib.rs | 2 +- .../sui-json-rpc-tests/tests/routing_tests.rs | 12 +- .../tests/subscription_tests.rs | 48 -------- crates/sui-json-rpc/Cargo.toml | 1 + crates/sui-json-rpc/src/lib.rs | 16 +-- crates/sui-node/src/lib.rs | 8 +- .../sui-source-validation-service/src/lib.rs | 87 ++----------- .../tests/tests.rs | 1 + .../src/node_config_builder.rs | 4 +- ...ests__network_config_snapshot_matches.snap | 21 ++-- crates/test-cluster/src/lib.rs | 2 +- sdk/typescript/test/e2e/subscribe.test.ts | 35 ------ 15 files changed, 59 insertions(+), 312 deletions(-) delete mode 100644 crates/sui-json-rpc-tests/tests/subscription_tests.rs delete mode 100644 sdk/typescript/test/e2e/subscribe.test.ts diff --git a/Cargo.lock b/Cargo.lock index f3bd724bad987..2a3a851e16985 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12917,6 +12917,7 @@ dependencies = [ "serde_json", "shared-crypto", "signature 1.6.4", + "sui-config", "sui-core", "sui-json", "sui-json-rpc-api", diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 0457473f192ee..ed316f6fa3491 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -76,9 +76,12 @@ pub struct NodeConfig { #[serde(default = "default_enable_index_processing")] pub enable_index_processing: bool, - // only alow websocket connections for jsonrpc traffic #[serde(default)] - pub websocket_only: bool, + /// Determines the jsonrpc server type as either: + /// - 'websocket' for a websocket based service (deprecated) + /// - 'http' for an http based service + /// - 'both' for both a websocket and http based service (deprecated) + pub jsonrpc_server_type: Option, #[serde(default)] pub grpc_load_shed: Option, @@ -193,6 +196,14 @@ pub enum ExecutionCacheConfig { }, } +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum ServerType { + WebSocket, + Http, + Both, +} + #[derive(Clone, Debug, Deserialize, Serialize, Default)] #[serde(rename_all = "kebab-case")] pub struct TransactionKeyValueStoreReadConfig { @@ -368,6 +379,10 @@ impl NodeConfig { }) .collect() } + + pub fn jsonrpc_server_type(&self) -> ServerType { + self.jsonrpc_server_type.unwrap_or(ServerType::Http) + } } #[derive(Debug, Clone, Deserialize, Serialize)] diff --git a/crates/sui-e2e-tests/tests/full_node_tests.rs b/crates/sui-e2e-tests/tests/full_node_tests.rs index 58cf43a877e57..62fbb69b0d62f 100644 --- a/crates/sui-e2e-tests/tests/full_node_tests.rs +++ b/crates/sui-e2e-tests/tests/full_node_tests.rs @@ -2,21 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 use futures::future; -use jsonrpsee::core::client::{ClientT, Subscription, SubscriptionClientT}; +use jsonrpsee::core::client::ClientT; use jsonrpsee::rpc_params; use move_core_types::annotated_value::MoveStructLayout; use move_core_types::ident_str; -use move_core_types::parser::parse_struct_tag; use rand::rngs::OsRng; -use serde_json::json; use std::sync::Arc; use sui::client_commands::{OptsWithGas, SuiClientCommandResult, SuiClientCommands}; use sui_config::node::RunWithRange; +use sui_json_rpc_types::{EventFilter, TransactionFilter}; use sui_json_rpc_types::{ - type_and_fields_from_move_event_data, EventPage, SuiEvent, SuiExecutionStatus, - SuiTransactionBlockEffectsAPI, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions, + EventPage, SuiEvent, SuiExecutionStatus, SuiTransactionBlockEffectsAPI, + SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions, }; -use sui_json_rpc_types::{EventFilter, TransactionFilter}; use sui_keys::keystore::AccountKeystore; use sui_macros::*; use sui_node::SuiNodeHandle; @@ -33,7 +31,6 @@ use sui_types::base_types::{ObjectID, SuiAddress, TransactionDigest}; use sui_types::base_types::{ObjectRef, SequenceNumber}; use sui_types::crypto::{get_key_pair, SuiKeyPair}; use sui_types::error::{SuiError, UserInputError}; -use sui_types::event::{Event, EventID}; use sui_types::message_envelope::Message; use sui_types::messages_grpc::TransactionInfoRequest; use sui_types::object::{Object, ObjectRead, Owner, PastObjectRead}; @@ -47,13 +44,11 @@ use sui_types::transaction::{ CallArg, GasData, TransactionData, TransactionKind, TEST_ONLY_GAS_UNIT_FOR_OBJECT_BASICS, TEST_ONLY_GAS_UNIT_FOR_SPLIT_COIN, TEST_ONLY_GAS_UNIT_FOR_TRANSFER, }; -use sui_types::type_resolver::get_layout_from_struct_tag; use sui_types::utils::{ to_sender_signed_transaction, to_sender_signed_transaction_with_multi_signers, }; use test_cluster::TestClusterBuilder; use tokio::sync::Mutex; -use tokio::time::timeout; use tokio::time::{sleep, Duration}; use tracing::info; @@ -638,107 +633,6 @@ async fn do_test_full_node_sync_flood() { .unwrap(); } -#[sim_test] -async fn test_full_node_sub_and_query_move_event_ok() -> Result<(), anyhow::Error> { - let mut test_cluster = TestClusterBuilder::new() - .enable_fullnode_events() - .build() - .await; - - // Start a new fullnode that is not on the write path - let fullnode = test_cluster.spawn_new_fullnode().await; - - let ws_client = fullnode.ws_client().await; - let node = fullnode.sui_node; - - let context = &mut test_cluster.wallet; - let package_id = publish_nfts_package(context).await.0; - - let struct_tag_str = format!("{package_id}::devnet_nft::MintNFTEvent"); - let struct_tag = parse_struct_tag(&struct_tag_str).unwrap(); - - let mut sub: Subscription = ws_client - .subscribe( - "suix_subscribeEvent", - rpc_params![EventFilter::MoveEventType(struct_tag.clone())], - "suix_unsubscribeEvent", - ) - .await - .unwrap(); - - let (sender, object_id, digest) = create_devnet_nft(context, package_id).await; - node.state() - .get_transaction_cache_reader() - .notify_read_executed_effects(&[digest]) - .await - .unwrap(); - - // Wait for streaming - let bcs = match timeout(Duration::from_secs(5), sub.next()).await { - Ok(Some(Ok(SuiEvent { - type_, - parsed_json, - bcs, - .. - }))) => { - assert_eq!(&type_, &struct_tag); - assert_eq!( - parsed_json, - json!({ - "creator" : sender, - "name": "example_nft_name", - "object_id" : object_id, - }) - ); - bcs - } - other => panic!("Failed to get SuiEvent, but {:?}", other), - }; - let struct_tag = parse_struct_tag(&struct_tag_str).unwrap(); - let layout = get_layout_from_struct_tag( - struct_tag.clone(), - &**node.state().epoch_store_for_testing().module_cache(), - )?; - - let expected_parsed_event = Event::move_event_to_move_value(&bcs, layout).unwrap(); - let (_, expected_parsed_events) = - type_and_fields_from_move_event_data(expected_parsed_event).unwrap(); - let expected_event = SuiEvent { - id: EventID { - tx_digest: digest, - event_seq: 0, - }, - package_id, - transaction_module: ident_str!("devnet_nft").into(), - sender, - type_: struct_tag, - parsed_json: expected_parsed_events, - bcs, - timestamp_ms: None, - }; - - // get tx events - let events = test_cluster - .sui_client() - .event_api() - .get_events(digest) - .await?; - assert_eq!(events.len(), 1); - assert_eq!(events[0], expected_event); - assert_eq!(events[0].id.tx_digest, digest); - - // No more - match timeout(Duration::from_secs(5), sub.next()).await { - Err(_) => (), - other => panic!( - "Expect to time out because no new events are coming in. Got {:?}", - other - ), - } - - Ok(()) -} - // Test fullnode has event read jsonrpc endpoints working #[sim_test] async fn test_full_node_event_read_api_ok() { diff --git a/crates/sui-indexer/src/lib.rs b/crates/sui-indexer/src/lib.rs index 78997261860c9..6c1794c5f340a 100644 --- a/crates/sui-indexer/src/lib.rs +++ b/crates/sui-indexer/src/lib.rs @@ -202,7 +202,7 @@ pub async fn build_json_rpc_server( .start( default_socket_addr, custom_runtime, - Some(ServerType::Http), + ServerType::Http, Some(cancel), ) .await?) diff --git a/crates/sui-json-rpc-tests/tests/routing_tests.rs b/crates/sui-json-rpc-tests/tests/routing_tests.rs index 9cbc963194fb9..12d8c82795336 100644 --- a/crates/sui-json-rpc-tests/tests/routing_tests.rs +++ b/crates/sui-json-rpc-tests/tests/routing_tests.rs @@ -13,7 +13,7 @@ use jsonrpsee::RpcModule; use prometheus::Registry; use std::env; use sui_config::local_ip_utils; -use sui_json_rpc::{JsonRpcServerBuilder, SuiRpcModule}; +use sui_json_rpc::{JsonRpcServerBuilder, ServerType, SuiRpcModule}; use sui_json_rpc_api::CLIENT_TARGET_API_VERSION_HEADER; use sui_open_rpc::Module; use sui_open_rpc_macros::open_rpc; @@ -24,7 +24,10 @@ async fn test_rpc_backward_compatibility() { builder.register_module(TestApiModule).unwrap(); let address = local_ip_utils::new_local_tcp_socket_for_testing(); - let _handle = builder.start(address, None, None, None).await.unwrap(); + let _handle = builder + .start(address, None, ServerType::Http, None) + .await + .unwrap(); let url = format!("http://0.0.0.0:{}", address.port()); // Test with un-versioned client @@ -103,7 +106,10 @@ async fn test_disable_routing() { builder.register_module(TestApiModule).unwrap(); let address = local_ip_utils::new_local_tcp_socket_for_testing(); - let _handle = builder.start(address, None, None, None).await.unwrap(); + let _handle = builder + .start(address, None, ServerType::Http, None) + .await + .unwrap(); let url = format!("http://0.0.0.0:{}", address.port()); // try to access old method directly should fail diff --git a/crates/sui-json-rpc-tests/tests/subscription_tests.rs b/crates/sui-json-rpc-tests/tests/subscription_tests.rs deleted file mode 100644 index adfb52e2c9d5f..0000000000000 --- a/crates/sui-json-rpc-tests/tests/subscription_tests.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -use std::time::Duration; - -use jsonrpsee::core::client::{Subscription, SubscriptionClientT}; -use jsonrpsee::rpc_params; -use sui_test_transaction_builder::{create_devnet_nft, publish_nfts_package}; -use tokio::time::timeout; - -use sui_core::test_utils::wait_for_tx; -use sui_json_rpc_types::{ - SuiTransactionBlockEffects, SuiTransactionBlockEffectsAPI, TransactionFilter, -}; -use test_cluster::TestClusterBuilder; - -#[tokio::test] -async fn test_subscribe_transaction() -> Result<(), anyhow::Error> { - let cluster = TestClusterBuilder::new().build().await; - - let address = &cluster.get_address_0(); - let wallet = cluster.wallet; - - let ws_client = cluster.fullnode_handle.ws_client().await; - - let package_id = publish_nfts_package(&wallet).await.0; - - let mut sub: Subscription = ws_client - .subscribe( - "suix_subscribeTransaction", - rpc_params![TransactionFilter::FromAddress(*address)], - "suix_unsubscribeTransaction", - ) - .await - .unwrap(); - - let (_, _, digest) = create_devnet_nft(&wallet, package_id).await; - wait_for_tx(digest, cluster.fullnode_handle.sui_node.state()).await; - - // Wait for streaming - let effects = match timeout(Duration::from_secs(5), sub.next()).await { - Ok(Some(Ok(tx))) => tx, - _ => panic!("Failed to get tx"), - }; - - assert_eq!(&digest, effects.transaction_digest()); - Ok(()) -} diff --git a/crates/sui-json-rpc/Cargo.toml b/crates/sui-json-rpc/Cargo.toml index 721d50c9083d7..e03790cecfaa4 100644 --- a/crates/sui-json-rpc/Cargo.toml +++ b/crates/sui-json-rpc/Cargo.toml @@ -46,6 +46,7 @@ sui-json-rpc-api.workspace = true sui-open-rpc.workspace = true sui-open-rpc-macros.workspace = true sui-protocol-config.workspace = true +sui-config.workspace = true sui-json-rpc-types.workspace = true sui-macros.workspace = true sui-transaction-builder.workspace = true diff --git a/crates/sui-json-rpc/src/lib.rs b/crates/sui-json-rpc/src/lib.rs index a8eda2e73f14e..694cb2ff3e17b 100644 --- a/crates/sui-json-rpc/src/lib.rs +++ b/crates/sui-json-rpc/src/lib.rs @@ -23,6 +23,7 @@ use tracing::info; pub use balance_changes::*; pub use object_changes::*; +pub use sui_config::node::ServerType; use sui_json_rpc_api::{ CLIENT_SDK_TYPE_HEADER, CLIENT_SDK_VERSION_HEADER, CLIENT_TARGET_API_VERSION_HEADER, }; @@ -75,11 +76,6 @@ pub fn sui_rpc_doc(version: &str) -> Project { ) } -pub enum ServerType { - WebSocket, - Http, -} - impl JsonRpcServerBuilder { pub fn new( version: &str, @@ -155,7 +151,7 @@ impl JsonRpcServerBuilder { .on_failure(()) } - pub async fn to_router(&self, server_type: Option) -> Result { + pub async fn to_router(&self, server_type: ServerType) -> Result { let routing = self.rpc_doc.method_routing.clone(); let disable_routing = env::var("DISABLE_BACKWARD_COMPATIBILITY") @@ -196,7 +192,7 @@ impl JsonRpcServerBuilder { let mut router = axum::Router::new(); match server_type { - Some(ServerType::WebSocket) => { + ServerType::WebSocket => { router = router .route( "/", @@ -207,7 +203,7 @@ impl JsonRpcServerBuilder { axum::routing::get(crate::axum_router::ws::ws_json_rpc_upgrade), ); } - Some(ServerType::Http) => { + ServerType::Http => { router = router .route( "/", @@ -222,7 +218,7 @@ impl JsonRpcServerBuilder { axum::routing::post(crate::axum_router::json_rpc_handler), ); } - None => { + ServerType::Both => { router = router .route( "/", @@ -258,7 +254,7 @@ impl JsonRpcServerBuilder { self, listen_address: SocketAddr, _custom_runtime: Option, - server_type: Option, + server_type: ServerType, cancel: Option, ) -> Result { let app = self.to_router(server_type).await?; diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index edb1837e71758..b0ddd4eea4398 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -32,7 +32,6 @@ use sui_core::execution_cache::build_execution_cache; use sui_core::storage::RestReadStore; use sui_core::traffic_controller::metrics::TrafficControllerMetrics; use sui_json_rpc::bridge_api::BridgeReadApi; -use sui_json_rpc::ServerType; use sui_json_rpc_api::JsonRpcMetrics; use sui_network::randomness; use sui_rest_api::RestMetrics; @@ -1898,11 +1897,8 @@ pub async fn build_http_server( ))?; server.register_module(MoveUtils::new(state.clone()))?; - let server_type = if config.websocket_only { - Some(ServerType::WebSocket) - } else { - None - }; + let server_type = config.jsonrpc_server_type(); + server.to_router(server_type).await? }; diff --git a/crates/sui-source-validation-service/src/lib.rs b/crates/sui-source-validation-service/src/lib.rs index 028fec879f907..7bb843b9c4560 100644 --- a/crates/sui-source-validation-service/src/lib.rs +++ b/crates/sui-source-validation-service/src/lib.rs @@ -20,14 +20,11 @@ use axum::{Json, Router, Server}; use hyper::http::{HeaderName, HeaderValue, Method}; use hyper::server::conn::AddrIncoming; use hyper::{HeaderMap, StatusCode}; -use jsonrpsee::core::client::{Subscription, SubscriptionClientT}; -use jsonrpsee::core::params::ArrayParams; -use jsonrpsee::ws_client::{WsClient, WsClientBuilder}; use mysten_metrics::RegistryService; use prometheus::{register_int_counter_with_registry, IntCounter, Registry}; use serde::{Deserialize, Serialize}; use tower::ServiceBuilder; -use tracing::{debug, error, info}; +use tracing::{debug, info}; use url::Url; use move_core_types::account_address::AccountAddress; @@ -35,7 +32,7 @@ use move_package::{BuildConfig as MoveBuildConfig, LintFlag}; use move_symbol_pool::Symbol; use sui_move::manage_package::resolve_lock_file_path; use sui_move_build::{BuildConfig, SuiPackageHooks}; -use sui_sdk::rpc_types::{SuiTransactionBlockEffects, TransactionFilter}; +use sui_sdk::rpc_types::SuiTransactionBlockEffects; use sui_sdk::types::base_types::ObjectID; use sui_sdk::SuiClientBuilder; use sui_source_validation::{BytecodeSourceVerifier, SourceMode}; @@ -431,82 +428,12 @@ pub async fn verify_packages(config: &Config, dir: &Path) -> anyhow::Result, - app_state: Arc>, - network: Network, - channel: Option>, + _packages: Vec, + _app_state: Arc>, + _network: Network, + _channel: Option>, ) -> anyhow::Result<()> { - let mut watch_ids = ArrayParams::new(); - let mut num_packages = 0; - for s in packages { - let branches = match s { - PackageSource::Repository(RepositorySource { branches, .. }) => branches, - PackageSource::Directory(DirectorySource { paths, .. }) => vec![Branch { - branch: "".into(), // Unused. - paths, - }], - }; - for b in branches { - for p in b.paths { - if let Some(id) = p.watch { - num_packages += 1; - watch_ids.insert(TransactionFilter::ChangedObject(id))? - } - } - } - } - - let websocket_url = match network { - Network::Mainnet => MAINNET_WS_URL, - Network::Testnet => TESTNET_WS_URL, - Network::Devnet => DEVNET_WS_URL, - Network::Localnet => LOCALNET_WS_URL, - }; - - let client: WsClient = WsClientBuilder::default() - .ping_interval(WS_PING_INTERVAL) - .build(websocket_url) - .await?; - let mut subscription: Subscription = client - .subscribe( - "suix_subscribeTransaction", - watch_ids, - "suix_unsubscribeTransaction", - ) - .await - .map_err(|e| anyhow!("Failed to open websocket connection for {}: {}", network, e))?; - - info!("Listening for upgrades on {num_packages} package(s) on {websocket_url}..."); - loop { - let result: Option> = subscription.next().await; - match result { - Some(Ok(result)) => { - // We see an upgrade transaction. Clear all sources since all of part of these may now be invalid. - // Currently we need to restart the server within some time delta of this observation to resume - // returning source. Restarting revalidates the latest release sources per repositories in the config file. - // Restarting is a manual side-effect outside of this server because we need to ensure that sources in the - // repositories _actually contain_ the latest source corresponding to on-chain data (which is subject to - // manual syncing itself currently). - info!("Saw upgrade txn: {:?}", result); - let mut app_state = app_state.write().unwrap(); - app_state.sources = NetworkLookup::new(); // Clear all sources. - app_state.sources_list = NetworkLookup::new(); // Clear all listed sources. - if let Some(channel) = channel { - channel.send(result).unwrap(); - break Ok(()); - } - info!("Shutting down server (resync performed on restart)"); - std::process::exit(1) - } - Some(_) => { - info!("Saw failed transaction when listening to upgrades.") - } - None => { - error!("Fatal: WebSocket connection lost while listening for upgrades. Shutting down server."); - std::process::exit(1) - } - } - } + Err(anyhow!("Fatal: JsonRPC Subscriptions no longer supported. Reimplement without using subscriptions.")) } pub struct AppState { diff --git a/crates/sui-source-validation-service/tests/tests.rs b/crates/sui-source-validation-service/tests/tests.rs index 901f36f1a297b..3fe162b11ccdd 100644 --- a/crates/sui-source-validation-service/tests/tests.rs +++ b/crates/sui-source-validation-service/tests/tests.rs @@ -35,6 +35,7 @@ const TEST_FIXTURES_DIR: &str = "tests/fixture"; #[allow(clippy::await_holding_lock)] #[tokio::test] +#[ignore] async fn test_end_to_end() -> anyhow::Result<()> { move_package::package_hooks::register_package_hooks(Box::new(SuiPackageHooks)); let mut test_cluster = TestClusterBuilder::new() diff --git a/crates/sui-swarm-config/src/node_config_builder.rs b/crates/sui-swarm-config/src/node_config_builder.rs index daec39aaa7403..281a3d5a77e0a 100644 --- a/crates/sui-swarm-config/src/node_config_builder.rs +++ b/crates/sui-swarm-config/src/node_config_builder.rs @@ -232,7 +232,7 @@ impl ValidatorConfigBuilder { zklogin_oauth_providers: default_zklogin_oauth_providers(), authority_overload_config: self.authority_overload_config.unwrap_or_default(), run_with_range: None, - websocket_only: false, + jsonrpc_server_type: None, policy_config: self.policy_config, firewall_config: self.firewall_config, execution_cache: ExecutionCacheConfig::default(), @@ -500,7 +500,7 @@ impl FullnodeConfigBuilder { zklogin_oauth_providers: default_zklogin_oauth_providers(), authority_overload_config: Default::default(), run_with_range: self.run_with_range, - websocket_only: false, + jsonrpc_server_type: None, policy_config: self.policy_config, firewall_config: self.fw_config, execution_cache: ExecutionCacheConfig::default(), diff --git a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap index 0d6d1a271b8a0..670df6558daf3 100644 --- a/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap +++ b/crates/sui-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap @@ -44,9 +44,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: @@ -180,9 +179,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: @@ -316,9 +314,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: @@ -452,9 +449,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: @@ -588,9 +584,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: @@ -724,9 +719,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: @@ -860,9 +854,8 @@ validator_configs: send_certificate_rate_limit: ~ report_batch_rate_limit: ~ request_batches_rate_limit: ~ - enable-event-processing: false enable-index-processing: true - websocket-only: false + jsonrpc-server-type: ~ grpc-load-shed: ~ grpc-concurrency-limit: 20000000000 p2p-config: diff --git a/crates/test-cluster/src/lib.rs b/crates/test-cluster/src/lib.rs index f6ecefe0729da..4b2af1969efc8 100644 --- a/crates/test-cluster/src/lib.rs +++ b/crates/test-cluster/src/lib.rs @@ -1160,7 +1160,7 @@ impl TestClusterBuilder { wallet_conf.envs.push(SuiEnv { alias: "localnet".to_string(), rpc: fullnode_handle.rpc_url.clone(), - ws: Some(fullnode_handle.ws_url.clone()), + ws: None, basic_auth: None, }); wallet_conf.active_env = Some("localnet".to_string()); diff --git a/sdk/typescript/test/e2e/subscribe.test.ts b/sdk/typescript/test/e2e/subscribe.test.ts deleted file mode 100644 index bc2bdaa80791f..0000000000000 --- a/sdk/typescript/test/e2e/subscribe.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -import { expect, test } from 'vitest'; - -import { Transaction } from '../../src/transactions'; -import { setup } from './utils/setup'; - -test('subscribeTransaction', async () => { - const toolbox = await setup(); - - expect( - // eslint-disable-next-line no-async-promise-executor - new Promise(async (resolve, reject) => { - try { - await toolbox.client.subscribeTransaction({ - filter: { FromAddress: toolbox.address() }, - onMessage() { - resolve(true); - }, - }); - - const tx = new Transaction(); - const [coin] = tx.splitCoins(tx.gas, [1]); - tx.transferObjects([coin], toolbox.address()); - await toolbox.client.signAndExecuteTransaction({ - signer: toolbox.keypair, - transaction: tx, - }); - } catch (e) { - reject(e); - } - }), - ).resolves.toBeTruthy(); -});