From b428fbcc86a0bfee8c52383e2bc5507a477a2390 Mon Sep 17 00:00:00 2001 From: officeyutong Date: Thu, 19 Dec 2024 22:31:12 +0800 Subject: [PATCH 1/9] update: use fixed store name for wasm; use path as db name --- network/src/peer_store/browser.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/network/src/peer_store/browser.rs b/network/src/peer_store/browser.rs index 20fd775fd5..691c88c34a 100644 --- a/network/src/peer_store/browser.rs +++ b/network/src/peer_store/browser.rs @@ -59,6 +59,8 @@ pub async fn get_db>(path: P) -> &'static Storage { DB.get_or_init(|| Storage::new(path)).await } +const STORE_NAME: &str = "main-store"; + #[derive(Clone)] pub struct Storage { chan: tokio::sync::mpsc::Sender, @@ -67,15 +69,14 @@ pub struct Storage { impl Storage { pub async fn new>(path: P) -> Self { let factory = Factory::new().unwrap(); - let mut open_request = factory.open("network", Some(1)).unwrap(); - let store_name = path.as_ref().to_str().unwrap().to_owned(); - let store_name_clone = store_name.clone(); + let database_name = path.as_ref().to_str().unwrap().to_owned(); + let mut open_request = factory.open(&database_name, Some(1)).unwrap(); open_request.on_upgrade_needed(move |event| { let database = event.database().unwrap(); let store_params = ObjectStoreParams::new(); let store = database - .create_object_store(&store_name_clone, store_params) + .create_object_store(STORE_NAME, store_params) .unwrap(); let mut index_params = IndexParams::new(); index_params.unique(true); @@ -92,9 +93,9 @@ impl Storage { match request.cmd { CommandRequest::Read { key } => { let tran = db - .transaction(&[&store_name], TransactionMode::ReadOnly) + .transaction(&[STORE_NAME], TransactionMode::ReadOnly) .unwrap(); - let store = tran.object_store(&store_name).unwrap(); + let store = tran.object_store(STORE_NAME).unwrap(); let key = serde_wasm_bindgen::to_value(&key).unwrap(); let value = store .get(key) @@ -107,9 +108,9 @@ impl Storage { } CommandRequest::Put { kv } => { let tran = db - .transaction(&[&store_name], TransactionMode::ReadWrite) + .transaction(&[STORE_NAME], TransactionMode::ReadWrite) .unwrap(); - let store = tran.object_store(&store_name).unwrap(); + let store = tran.object_store(STORE_NAME).unwrap(); let key = serde_wasm_bindgen::to_value(&kv.key).unwrap(); let value = serde_wasm_bindgen::to_value(&kv).unwrap(); From c02a7cefe90123b5348fa086272f34640a1a41d8 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Thu, 26 Dec 2024 15:31:57 +0800 Subject: [PATCH 2/9] Extract `TransactionScriptsVerifier::map_vm_internal_error` Signed-off-by: Eval EXEC --- script/src/verify.rs | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/script/src/verify.rs b/script/src/verify.rs index f2bf0d44a0..141910fc25 100644 --- a/script/src/verify.rs +++ b/script/src/verify.rs @@ -1046,10 +1046,6 @@ where } else { Scheduler::new(tx_data, version, self.syscalls_generator.clone()) }; - let map_vm_internal_error = |error: VMInternalError| match error { - VMInternalError::CyclesExceeded => ScriptError::ExceededMaximumCycles(max_cycles), - _ => ScriptError::VMInternalError(error), - }; let previous_cycles = scheduler.consumed_cycles(); let res = scheduler.run(RunMode::LimitCycles(max_cycles)); match res { @@ -1068,10 +1064,12 @@ where } Err(error) => match error { VMInternalError::CyclesExceeded | VMInternalError::Pause => { - let snapshot = scheduler.suspend().map_err(map_vm_internal_error)?; + let snapshot = scheduler + .suspend() + .map_err(|err| self.map_vm_internal_error(err, max_cycles))?; Ok(ChunkState::suspended(snapshot)) } - _ => Err(map_vm_internal_error(error)), + _ => Err(self.map_vm_internal_error(error, max_cycles)), }, } } @@ -1149,13 +1147,9 @@ where max_cycles: Cycle, ) -> Result<(i8, Cycle), ScriptError> { let mut scheduler = self.create_scheduler(script_group)?; - let map_vm_internal_error = |error: VMInternalError| match error { - VMInternalError::CyclesExceeded => ScriptError::ExceededMaximumCycles(max_cycles), - _ => ScriptError::VMInternalError(error), - }; scheduler .run(RunMode::LimitCycles(max_cycles)) - .map_err(map_vm_internal_error) + .map_err(|err| self.map_vm_internal_error(err, max_cycles)) } fn run(&self, script_group: &ScriptGroup, max_cycles: Cycle) -> Result { @@ -1168,6 +1162,14 @@ where } } + fn map_vm_internal_error(&self, error: VMInternalError, max_cycles: Cycle) -> ScriptError { + match error { + VMInternalError::CyclesExceeded => ScriptError::ExceededMaximumCycles(max_cycles), + VMInternalError::External(reason) if reason.eq("stopped") => ScriptError::Interrupts, + _ => ScriptError::VMInternalError(error), + } + } + #[cfg(not(target_family = "wasm"))] async fn chunk_run_with_signal( &self, @@ -1184,12 +1186,6 @@ where }; let version = self.select_version(&script_group.script)?; let mut scheduler = Scheduler::new(tx_data, version, self.syscalls_generator.clone()); - let map_vm_internal_error = |error: VMInternalError| match error { - VMInternalError::CyclesExceeded => ScriptError::ExceededMaximumCycles(max_cycles), - VMInternalError::External(reason) if reason.eq("stopped") => ScriptError::Interrupts, - _ => ScriptError::VMInternalError(error), - }; - let mut pause = VMPause::new(); let child_pause = pause.clone(); let (finish_tx, mut finish_rx) = oneshot::channel::>(); @@ -1264,7 +1260,7 @@ where exit_code ))}, Err(err) => { - return Err(map_vm_internal_error(err)); + return Err(self.map_vm_internal_error(err, max_cycles)); } } From 94cc2285b43a00142d009fc50a6c8a1e986578fe Mon Sep 17 00:00:00 2001 From: chloefeal <188809157+chloefeal@users.noreply.github.com> Date: Sat, 28 Dec 2024 10:54:42 +0800 Subject: [PATCH 3/9] fix: typo --- script/src/scheduler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/src/scheduler.rs b/script/src/scheduler.rs index eecf423b9d..aee25168a8 100644 --- a/script/src/scheduler.rs +++ b/script/src/scheduler.rs @@ -560,7 +560,7 @@ where _ => (), } } - // Transfering data from write fds to read fds + // Transferring data from write fds to read fds for (read_vm_id, read_state, write_vm_id, write_state) in pairs { let ReadState { length: read_length, From eb2276c13c4905b4b99526b28fae7cf34597c96f Mon Sep 17 00:00:00 2001 From: chloefeal <188809157+chloefeal@users.noreply.github.com> Date: Sat, 28 Dec 2024 10:54:49 +0800 Subject: [PATCH 4/9] fix: typo --- script/testdata/spawn_cases.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/testdata/spawn_cases.c b/script/testdata/spawn_cases.c index 171164df03..121291cb06 100644 --- a/script/testdata/spawn_cases.c +++ b/script/testdata/spawn_cases.c @@ -121,7 +121,7 @@ int parent_invalid_fd(uint64_t* pid) { err = ckb_write(fds[CKB_STDOUT], data, &data_length); CHECK2(err == CKB_OTHER_END_CLOSED, -2); - // read from fd but the ohter end is closed + // read from fd but the other end is closed err = ckb_pipe(fds); CHECK(err); err = ckb_close(fds[CKB_STDOUT]); From 4ebd2d521ea9cbf2f888a8f10e79f9a711803bb9 Mon Sep 17 00:00:00 2001 From: chloefeal <188809157+chloefeal@users.noreply.github.com> Date: Sat, 28 Dec 2024 10:54:53 +0800 Subject: [PATCH 5/9] fix: typo --- util/app-config/src/configs/indexer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/app-config/src/configs/indexer.rs b/util/app-config/src/configs/indexer.rs index 1f44a68aa6..0406efd455 100644 --- a/util/app-config/src/configs/indexer.rs +++ b/util/app-config/src/configs/indexer.rs @@ -35,7 +35,7 @@ pub struct IndexerConfig { /// The init tip block hash #[serde(default)] pub init_tip_hash: Option, - /// limit of indexer reqeust + /// limit of indexer request #[serde(default)] pub request_limit: Option, /// Rich indexer config options From 2814ed2b43f294e4be80ced75fe0bcf5b14f6a69 Mon Sep 17 00:00:00 2001 From: chloefeal <188809157+chloefeal@users.noreply.github.com> Date: Sat, 28 Dec 2024 10:55:00 +0800 Subject: [PATCH 6/9] fix: typo --- util/fee-estimator/src/estimator/weight_units_flow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/fee-estimator/src/estimator/weight_units_flow.rs b/util/fee-estimator/src/estimator/weight_units_flow.rs index a834d5a9b0..6349165c5d 100644 --- a/util/fee-estimator/src/estimator/weight_units_flow.rs +++ b/util/fee-estimator/src/estimator/weight_units_flow.rs @@ -36,7 +36,7 @@ //! - New transactions entering the mempool. //! //! While it's impossible to predict sudden changes to the speed at which new -//! weight is added to the mempool, for simplicty's sake we're going to assume +//! weight is added to the mempool, for simplicity's sake we're going to assume //! the flow we measured remains constant: `added_weight = flow * blocks`. //! //! - Transactions leaving the mempool due to mined blocks. Each block removes From 606b0a6d3d6b50d9f16f63fbf98b582fea258828 Mon Sep 17 00:00:00 2001 From: driftluo Date: Thu, 2 Jan 2025 16:33:35 +0800 Subject: [PATCH 7/9] chore: upgrade p2p --- Cargo.lock | 188 ++++++++++++++++++++++++++--------------- network/src/network.rs | 5 +- 2 files changed, 123 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d31ae5a3a2..8f98a9ae83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,7 +180,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -191,7 +191,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -256,7 +256,7 @@ dependencies = [ "sha1", "sync_wrapper 1.0.1", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.24.0", "tower 0.5.1", "tower-layer", "tower-service", @@ -336,7 +336,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.94", "which", ] @@ -481,7 +481,7 @@ dependencies = [ "sha2", "ssri", "tempfile", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "walkdir", @@ -845,7 +845,7 @@ dependencies = [ "faster-hex", "rand 0.8.5", "secp256k1", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -912,7 +912,7 @@ dependencies = [ "anyhow", "ckb-occupied-capacity", "derive_more 1.0.0", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -923,7 +923,7 @@ dependencies = [ "ckb-logger", "ckb-types", "ckb-util", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -942,7 +942,7 @@ dependencies = [ "faster-hex", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1026,7 +1026,7 @@ dependencies = [ "numext-fixed-uint", "rhai", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -1524,7 +1524,7 @@ dependencies = [ "ckb_schemars", "proc-macro2", "serde_json", - "syn 2.0.79", + "syn 2.0.94", "tera", "walkdir", ] @@ -2278,7 +2278,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -2320,7 +2320,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -2331,7 +2331,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -2390,7 +2390,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -2410,7 +2410,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", "unicode-xid", ] @@ -2446,7 +2446,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -2509,7 +2509,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -2605,7 +2605,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", "uuid", ] @@ -2770,7 +2770,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -3103,7 +3103,7 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tokio", "tracing", @@ -3126,7 +3126,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -3476,7 +3476,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -3487,7 +3487,7 @@ checksum = "3afe8830d5802f769dc0be20a87f9f116798c896650cb6266eb5c19a3c109eed" dependencies = [ "js-sys", "num-traits", - "thiserror", + "thiserror 1.0.64", "tokio", "wasm-bindgen", "web-sys", @@ -3782,7 +3782,7 @@ checksum = "34fe3ce66f7e4909575f6be478862325559bf5b5d0a681d106aae2c9849e1857" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -3960,7 +3960,7 @@ checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ "miette-derive", "once_cell", - "thiserror", + "thiserror 1.0.64", "unicode-width", ] @@ -3972,7 +3972,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -4223,7 +4223,7 @@ dependencies = [ "numext-constructor", "rand 0.7.3", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4288,7 +4288,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -4446,7 +4446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.64", "ucd-trie", ] @@ -4470,7 +4470,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -4587,7 +4587,7 @@ checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -4706,7 +4706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -4735,9 +4735,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -4754,7 +4754,7 @@ dependencies = [ "memchr", "parking_lot 0.12.3", "protobuf", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4809,7 +4809,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -5124,7 +5124,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -5482,7 +5482,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "time", "url", "uuid", @@ -5516,7 +5516,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -5743,7 +5743,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1008d95d2ec2d062959352527be30e10fec42a1aa5e5a48d990a5ff0fb9bdc0" dependencies = [ "anyhow", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5803,7 +5803,7 @@ dependencies = [ "sha2", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -5821,7 +5821,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -5844,7 +5844,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.79", + "syn 2.0.94", "tempfile", "tokio", "url", @@ -5887,7 +5887,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.64", "tracing", "whoami", ] @@ -5925,7 +5925,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.64", "tracing", "whoami", ] @@ -5966,7 +5966,7 @@ dependencies = [ "serde", "sha-1", "sha2", - "thiserror", + "thiserror 1.0.64", "xxhash-rust", ] @@ -6024,9 +6024,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" dependencies = [ "proc-macro2", "quote", @@ -6056,7 +6056,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -6095,9 +6095,9 @@ dependencies = [ [[package]] name = "tentacle" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494c11b8387d479641aca02d57a481020619df1fc6bc4a0aa3cb013459ab05be" +checksum = "7a3374cb0b9cf25499dcb2e9ecf199af2f778b8d40dd01c413536de5b1574a2b" dependencies = [ "async-trait", "bytes", @@ -6115,9 +6115,9 @@ dependencies = [ "socket2", "tentacle-multiaddr", "tentacle-secio", - "thiserror", + "thiserror 1.0.64", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.26.1", "tokio-util", "tokio-yamux", "wasm-bindgen", @@ -6218,7 +6218,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", ] [[package]] @@ -6229,7 +6238,18 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", ] [[package]] @@ -6384,7 +6404,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -6428,7 +6448,19 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite", + "tungstenite 0.24.0", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.26.1", ] [[package]] @@ -6583,7 +6615,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -6631,7 +6663,25 @@ dependencies = [ "log", "rand 0.8.5", "sha1", - "thiserror", + "thiserror 1.0.64", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", + "thiserror 2.0.9", "utf-8", ] @@ -6939,7 +6989,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", "wasm-bindgen-shared", ] @@ -6973,7 +7023,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7122,7 +7172,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -7133,7 +7183,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -7401,7 +7451,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", "synstructure", ] @@ -7423,7 +7473,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -7443,7 +7493,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", "synstructure", ] @@ -7464,7 +7514,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] [[package]] @@ -7486,5 +7536,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.94", ] diff --git a/network/src/network.rs b/network/src/network.rs index a8003aa3d3..d51fe87916 100644 --- a/network/src/network.rs +++ b/network/src/network.rs @@ -1527,7 +1527,10 @@ pub(crate) enum TransportType { } pub(crate) fn find_type(addr: &Multiaddr) -> TransportType { - if addr.iter().any(|proto| matches!(proto, Protocol::Ws)) { + if addr + .iter() + .any(|proto| matches!(proto, Protocol::Ws | Protocol::Wss)) + { TransportType::Ws } else { TransportType::Tcp From 14d27d28f2fc4f6c81f45a25af8991df55729951 Mon Sep 17 00:00:00 2001 From: NotNotARobot <164791169+NotNotARobot@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:23:43 -0500 Subject: [PATCH 8/9] fix: replace broken link in `CONTRIBUTING.md` --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ebb3b3ffd6..53243011a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ Please note we have a code of conduct, please follow it in all your interactions ### Report Issue -* Read [known issues](https://github.com/nervosnetwork/ckb/projects/2) to see whether the issue is already addressed there. +* Read [previous issues](https://github.com/nervosnetwork/ckb/issues) to see whether the issue is already addressed. * **Do not open up a GitHub issue to report security vulnerabilities**. Instead, refer to the [security policy](SECURITY.md). From c59161d4656a76aa570c6e9ea0eda7fc28da74d4 Mon Sep 17 00:00:00 2001 From: NotNotARobot <164791169+NotNotARobot@users.noreply.github.com> Date: Sun, 5 Jan 2025 13:23:17 -0500 Subject: [PATCH 9/9] fix: add missing word to echoed message --- devtools/ci/check-relaxed.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/ci/check-relaxed.sh b/devtools/ci/check-relaxed.sh index 8f5cab29c4..16eb087fba 100755 --- a/devtools/ci/check-relaxed.sh +++ b/devtools/ci/check-relaxed.sh @@ -5,7 +5,7 @@ set -euo pipefail case "$OSTYPE" in darwin*) if ! type gsed &>/dev/null || ! type ggrep &>/dev/null; then - echo "GNU sed and grep not found! You can install via Homebrew" >&2 + echo "GNU sed and grep not found! You can install them via Homebrew" >&2 echo >&2 echo " brew install grep gnu-sed" >&2 exit 1