diff --git a/Cargo.lock b/Cargo.lock index 9a4b6f05cf..e10576f0bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1352,7 +1352,7 @@ dependencies = [ "ckb-pow", "ckb-stop-handler", "ckb-types", - "console 0.15.11", + "console", "eaglesong", "futures", "http-body-util", @@ -1411,7 +1411,7 @@ dependencies = [ "serde-wasm-bindgen", "serde_json", "snap", - "socket2", + "socket2 0.5.10", "tempfile", "tentacle", "tokio", @@ -2140,19 +2140,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "console" -version = "0.15.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "unicode-width 0.2.2", - "windows-sys 0.59.0", -] - [[package]] name = "console" version = "0.16.1" @@ -2781,7 +2768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3623,7 +3610,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.5.10", "system-configuration", "tokio", "tower-service", @@ -3877,7 +3864,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88" dependencies = [ - "console 0.16.1", + "console", "portable-atomic", "rayon", "unicode-width 0.2.2", @@ -3909,7 +3896,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.10", "widestring", "windows-sys 0.48.0", "winreg 0.50.0", @@ -3948,7 +3935,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5648,7 +5635,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6214,6 +6201,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "spin" version = "0.5.2" @@ -6600,7 +6597,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix 1.1.2", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6623,7 +6620,7 @@ dependencies = [ "nohash-hasher", "parking_lot 0.12.5", "rand 0.8.5", - "socket2", + "socket2 0.5.10", "tentacle-multiaddr", "tentacle-secio", "thiserror 1.0.69", @@ -6884,28 +6881,27 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.2" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ - "backtrace", "bytes", "libc", "mio", "parking_lot 0.12.5", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.6.2", "tokio-macros", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", @@ -7026,7 +7022,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "socket2", + "socket2 0.5.10", "tokio", "tokio-stream", "tower 0.4.13", @@ -7655,7 +7651,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 984887a8d4..0cd1dc884b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -303,7 +303,7 @@ tera = "1" thiserror = "1.0.22" time = "0.3.36" tiny-keccak = "2.0" -tokio = "1.35.0" +tokio = "1.49.0" tokio-util = "0.7.8" toml = "0.5" torut = "0.2.1" diff --git a/test/src/specs/tx_pool/orphan_tx.rs b/test/src/specs/tx_pool/orphan_tx.rs index f47453b549..6aee533d3c 100644 --- a/test/src/specs/tx_pool/orphan_tx.rs +++ b/test/src/specs/tx_pool/orphan_tx.rs @@ -17,6 +17,8 @@ use ckb_types::{ const ALWAYS_SUCCESS_SCRIPT_CYCLE: u64 = 537; // always_failure, as the name implies, so it doesn't matter what the cycles are const ALWAYS_FAILURE_SCRIPT_CYCLE: u64 = 1000; +// Timeout in seconds for waiting for transactions to be processed into tx pool +const ORPHAN_TX_WAIT_TIMEOUT: u64 = 10; pub struct OrphanTxAccepted; @@ -38,7 +40,7 @@ impl Spec for OrphanTxAccepted { let child_tx = node0.new_transaction(parent_tx.hash()); relay_tx(&net, node0, child_tx, ALWAYS_SUCCESS_SCRIPT_CYCLE); - let result = wait_until(5, || { + let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || { let tx_pool_info = node0.get_tip_tx_pool_info(); tx_pool_info.orphan.value() == 1 && tx_pool_info.pending.value() == 0 }); @@ -48,7 +50,7 @@ impl Spec for OrphanTxAccepted { ); relay_tx(&net, node0, parent_tx, ALWAYS_SUCCESS_SCRIPT_CYCLE); - let result = wait_until(5, || { + let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || { let tx_pool_info = node0.get_tip_tx_pool_info(); tx_pool_info.orphan.value() == 0 && tx_pool_info.pending.value() == 2 }); @@ -80,7 +82,7 @@ impl Spec for OrphanTxRejected { let child_hash = child_tx.hash(); relay_tx(&net, node0, child_tx, ALWAYS_FAILURE_SCRIPT_CYCLE); - let result = wait_until(5, || { + let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || { let tx_pool_info = node0.get_tip_tx_pool_info(); tx_pool_info.orphan.value() == 1 && tx_pool_info.pending.value() == 0 }); @@ -90,7 +92,7 @@ impl Spec for OrphanTxRejected { ); relay_tx(&net, node0, parent_tx, ALWAYS_SUCCESS_SCRIPT_CYCLE); - let result = wait_until(5, || { + let result = wait_until(ORPHAN_TX_WAIT_TIMEOUT, || { let tx_pool_info = node0.get_tip_tx_pool_info(); tx_pool_info.orphan.value() == 0 && tx_pool_info.pending.value() == 1 }); @@ -191,7 +193,7 @@ fn run_replay_tx( ) -> bool { relay_tx(net, node0, tx, ALWAYS_SUCCESS_SCRIPT_CYCLE); - wait_until(5, || { + wait_until(ORPHAN_TX_WAIT_TIMEOUT, || { let tx_pool_info = node0.get_tip_tx_pool_info(); tx_pool_info.orphan.value() == orphan_tx_cnt && tx_pool_info.pending.value() == pending_cnt }) @@ -206,7 +208,7 @@ fn run_send_tx( ) -> bool { send_tx(net, node0, tx, ALWAYS_SUCCESS_SCRIPT_CYCLE); - wait_until(5, || { + wait_until(ORPHAN_TX_WAIT_TIMEOUT, || { let tx_pool_info = node0.get_tip_tx_pool_info(); tx_pool_info.orphan.value() == orphan_tx_cnt && tx_pool_info.pending.value() == pending_cnt })