From 7260c98414917f5839763722dba5fb244f23fc6f Mon Sep 17 00:00:00 2001 From: Carlos Baez Date: Mon, 9 Sep 2024 13:51:21 +0200 Subject: [PATCH] Merged to version 1.32.1 Signed-off-by: Carlos Baez --- Cargo.lock | 841 ++++++++---------- Cargo.toml | 6 +- crates/sui-core/src/authority.rs | 1 + .../event_connection/combo_filter_error.exp | 43 + .../event_connection/combo_filter_error.move | 51 ++ .../tests/event_connection/no_filter.exp | 254 ++++++ .../tests/event_connection/no_filter.move | 59 ++ .../tests/event_connection/tx_digest.exp | 326 +++++++ .../tests/event_connection/tx_digest.move | 226 +++++ .../tests/event_connection/type_filter.exp | 211 +++++ .../tests/event_connection/type_filter.move | 140 +++ .../event_connection/type_param_filter.exp | 182 ++++ .../event_connection/type_param_filter.move | 92 ++ crates/sui-graphql-rpc/schema.graphql | 6 +- .../sui-graphql-rpc/src/types/event/cursor.rs | 183 ++++ .../sui-graphql-rpc/src/types/event/filter.rs | 44 + .../src/types/event/lookups.rs | 158 ++++ crates/sui-graphql-rpc/src/types/event/mod.rs | 285 ++++++ crates/sui-graphql-rpc/src/types/query.rs | 4 +- .../sui-graphql-rpc/src/types/type_filter.rs | 115 +-- .../snapshot_tests__schema_sdl_export.snap | 6 +- .../pg/2023-08-19-044020_events/up.sql | 8 - crates/sui-indexer/src/models/events.rs | 16 - crates/sui-indexer/src/schema/mysql.rs | 9 - crates/sui-indexer/src/schema/pg.rs | 8 - crates/sui-indexer/tests/ingestion_tests.rs | 69 +- crates/sui-node/src/admin.rs | 5 - crates/sui-open-rpc/spec/openrpc.json | 2 +- crates/typed-store/src/metrics.rs | 34 +- crates/typed-store/src/rocks/mod.rs | 36 +- 30 files changed, 2725 insertions(+), 695 deletions(-) create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.exp create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.move create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.exp create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.move create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.exp create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.move create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.exp create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.move create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.exp create mode 100644 crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.move create mode 100644 crates/sui-graphql-rpc/src/types/event/cursor.rs create mode 100644 crates/sui-graphql-rpc/src/types/event/filter.rs create mode 100644 crates/sui-graphql-rpc/src/types/event/lookups.rs create mode 100644 crates/sui-graphql-rpc/src/types/event/mod.rs diff --git a/Cargo.lock b/Cargo.lock index fd91fa9a6cbee..b9c26e8f4cbad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ "tap", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower", "tracing", "x509-parser", @@ -217,7 +217,7 @@ dependencies = [ "prettyplease 0.2.22", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -311,9 +311,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" dependencies = [ "backtrace", ] @@ -837,7 +837,7 @@ dependencies = [ "arrow-schema 52.2.0", "chrono", "half", - "indexmap 2.4.0", + "indexmap 2.5.0", "lexical-core", "num", "serde", @@ -1104,14 +1104,14 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task 4.7.1", "concurrent-queue", - "fastrand 2.1.1", - "futures-lite 2.3.0", + "fastrand", + "futures-lite", "slab", ] @@ -1123,10 +1123,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.4", + "async-io", "async-lock 3.4.0", "blocking", - "futures-lite 2.3.0", + "futures-lite", "once_cell", ] @@ -1151,7 +1151,7 @@ dependencies = [ "futures-util", "handlebars", "http 1.1.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "lru 0.7.8", "mime", "multer", @@ -1184,7 +1184,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower-service", ] @@ -1201,7 +1201,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "strum 0.25.0", - "syn 2.0.76", + "syn 2.0.77", "thiserror", ] @@ -1224,31 +1224,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cf4d4e86208f4f9b81a503943c07e6e7f29ad3505e6c9ce6431fe64dc241681" dependencies = [ "bytes", - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_json", ] -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - [[package]] name = "async-io" version = "2.3.4" @@ -1259,10 +1239,10 @@ dependencies = [ "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "parking", - "polling 3.7.3", - "rustix 0.38.35", + "polling", + "rustix", "slab", "tracing", "windows-sys 0.59.0", @@ -1296,26 +1276,26 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "async-std" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" dependencies = [ "async-attributes", "async-channel 1.9.0", "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", + "async-io", + "async-lock 3.4.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 1.13.0", - "gloo-timers", + "futures-lite", + "gloo-timers 0.3.0", "kv-log-macro", "log", "memchr", @@ -1345,7 +1325,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1361,13 +1341,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1427,7 +1407,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7b2dbe9169059af0f821e811180fddc971fc210c776c133c7819ccd6e478db" dependencies = [ - "rustix 0.38.35", + "rustix", "tempfile", "windows-sys 0.52.0", ] @@ -1440,7 +1420,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1473,7 +1453,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.1", + "fastrand", "hex", "http 0.2.12", "hyper 0.14.30", @@ -1493,7 +1473,7 @@ checksum = "70a66ac8ef5fa9cf01c2d999f39d16812e90ec1467bd382cbbb74ba23ea86201" dependencies = [ "aws-smithy-async", "aws-smithy-types", - "fastrand 2.1.1", + "fastrand", "tokio", "tracing", "zeroize", @@ -1533,7 +1513,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", - "fastrand 2.1.1", + "fastrand", "http 0.2.12", "percent-encoding", "tracing", @@ -1558,7 +1538,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.1", + "fastrand", "http 0.2.12", "regex", "tokio-stream", @@ -1584,7 +1564,7 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "fastrand 2.1.1", + "fastrand", "http 0.2.12", "regex", "tokio-stream", @@ -1736,7 +1716,7 @@ dependencies = [ "aws-smithy-http-tower", "aws-smithy-types", "bytes", - "fastrand 2.1.1", + "fastrand", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", @@ -1779,7 +1759,7 @@ dependencies = [ "pin-project-lite", "pin-utils", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", ] @@ -1830,7 +1810,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.1.1", + "fastrand", "http 0.2.12", "http-body 0.4.6", "once_cell", @@ -2236,7 +2216,7 @@ checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bin-version" -version = "1.32.0" +version = "1.32.1" dependencies = [ "const-str", "git-version", @@ -2269,7 +2249,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2495,7 +2475,7 @@ dependencies = [ "async-channel 2.3.1", "async-task 4.7.1", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "piper", ] @@ -2657,9 +2637,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -2771,7 +2751,7 @@ checksum = "88e341d15ac1029aadce600be764a1a1edafe40e03cde23285bc1d261b3a4866" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.52.0", ] @@ -2783,7 +2763,7 @@ checksum = "434168fe6533055f0f4204039abe3ff6d7db338ef46872a5fa39e9d5ad5ab7a9" dependencies = [ "cap-primitives", "cap-std", - "rustix 0.38.35", + "rustix", "smallvec", ] @@ -2796,10 +2776,10 @@ dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "ipnet", "maybe-owned", - "rustix 0.38.35", + "rustix", "windows-sys 0.52.0", "winx", ] @@ -2822,8 +2802,8 @@ checksum = "593db20e4c51f62d3284bae7ee718849c3214f93a3b94ea1899ad85ba119d330" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 2.0.3", - "rustix 0.38.35", + "io-lifetimes", + "rustix", ] [[package]] @@ -2836,7 +2816,7 @@ dependencies = [ "cap-primitives", "iana-time-zone", "once_cell", - "rustix 0.38.35", + "rustix", "winx", ] @@ -2900,9 +2880,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", @@ -3032,9 +3012,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -3042,9 +3022,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -3062,7 +3042,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3268,7 +3248,7 @@ dependencies = [ "futures", "http 1.1.0", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-util", "itertools 0.10.5", "mockall", @@ -3278,7 +3258,7 @@ dependencies = [ "nom", "parking_lot 0.12.3", "prometheus", - "prost 0.13.1", + "prost 0.13.2", "quinn-proto", "rand 0.8.5", "rstest", @@ -3296,7 +3276,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.0", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tonic 0.12.2", "tonic-build 0.12.2", "tower", @@ -3558,9 +3538,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -4026,7 +4006,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4071,7 +4051,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "strsim 0.10.0", - "syn 2.0.76", + "syn 2.0.77", "thiserror", ] @@ -4081,7 +4061,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "718f6cd8c54ae5249fd42b0c86639df0100b8a86eea2e5f1b915cde2e1481453" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "lalrpop-util", "logos", ] @@ -4095,7 +4075,7 @@ dependencies = [ "cynic-codegen", "darling 0.20.10", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4167,7 +4147,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "strsim 0.11.1", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4200,7 +4180,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4282,7 +4262,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "url", "uuid 1.10.0", ] @@ -4509,7 +4489,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4553,7 +4533,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "rustc_version", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4575,9 +4555,9 @@ dependencies = [ [[package]] name = "diesel" -version = "2.2.3" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e13bab2796f412722112327f3e575601a3e9cdcbe426f0d30dbf43f3f5dc71" +checksum = "158fe8e2e68695bd615d7e4f3227c0727b151330d3e253b525086c348d055d5e" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -4601,7 +4581,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4614,7 +4594,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4634,7 +4614,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4774,7 +4754,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4855,7 +4835,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5072,7 +5052,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5111,7 +5091,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5132,7 +5112,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5339,7 +5319,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.76", + "syn 2.0.77", "toml 0.8.19", "walkdir", ] @@ -5357,7 +5337,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "serde_json", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5383,7 +5363,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.76", + "syn 2.0.77", "tempfile", "thiserror", "tiny-keccak", @@ -5747,15 +5727,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.1.1" @@ -5769,7 +5740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" dependencies = [ "cfg-if", - "rustix 0.38.35", + "rustix", "windows-sys 0.48.0", ] @@ -5780,7 +5751,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix 0.38.35", + "rustix", "windows-sys 0.52.0", ] @@ -5986,8 +5957,8 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes 2.0.3", - "rustix 0.38.35", + "io-lifetimes", + "rustix", "windows-sys 0.52.0", ] @@ -6076,28 +6047,13 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.1.1", + "fastrand", "futures-core", "futures-io", "parking", @@ -6122,7 +6078,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6143,7 +6099,7 @@ version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ - "gloo-timers", + "gloo-timers 0.2.6", "send_wrapper 0.4.0", ] @@ -6274,7 +6230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator 0.3.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "stable_deref_trait", ] @@ -6295,7 +6251,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6306,9 +6262,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -6329,6 +6285,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "governor" version = "0.6.3" @@ -6387,7 +6355,7 @@ dependencies = [ "fixedbitset 0.4.2", "guppy-summaries", "guppy-workspace-hack", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.13.0", "nested", "once_cell", @@ -6436,10 +6404,10 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", ] @@ -6455,10 +6423,10 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", ] @@ -6864,21 +6832,21 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.4.1", "hyper-util", "rustls 0.23.12", - "rustls-native-certs 0.7.3", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -7099,9 +7067,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -7169,9 +7137,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.39.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" dependencies = [ "console", "lazy_static", @@ -7206,21 +7174,10 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9f046b9af244f13b3bd939f55d16830ac3a201e8a9ba9661bfcb03e2be72b9b" dependencies = [ - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.52.0", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "io-lifetimes" version = "2.0.3" @@ -7229,9 +7186,9 @@ checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "ipnetwork" @@ -7450,7 +7407,7 @@ dependencies = [ "thiserror", "tokio", "tokio-rustls 0.23.4", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", "webpki-roots 0.22.6", ] @@ -7528,7 +7485,7 @@ dependencies = [ "soketto", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower", "tracing", ] @@ -7854,12 +7811,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -7907,7 +7858,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "regex-syntax 0.8.4", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -7948,9 +7899,9 @@ dependencies = [ [[package]] name = "lsp-server" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248f65b78f6db5d8e1b1604b4098a28b43d21a8eb1deeca22b1c421b276c7095" +checksum = "550446e84739dcaf6d48a4a093973850669e13e8a34d8f8d64851041be267cd9" dependencies = [ "crossbeam-channel", "log", @@ -8200,7 +8151,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.35", + "rustix", ] [[package]] @@ -8276,7 +8227,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -8878,7 +8829,7 @@ version = "0.1.0" dependencies = [ "enum-compat-util", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -9394,7 +9345,7 @@ dependencies = [ "fastcrypto-tbls", "hashbrown 0.12.3", "impl-trait-for-tuples", - "indexmap 2.4.0", + "indexmap 2.5.0", "mysten-util-mem-derive", "once_cell", "parking_lot 0.12.3", @@ -9477,7 +9428,7 @@ dependencies = [ "bytes", "fastcrypto", "futures", - "indexmap 2.4.0", + "indexmap 2.5.0", "mockall", "mysten-metrics", "narwhal-config", @@ -9591,7 +9542,7 @@ dependencies = [ "fastcrypto", "futures", "governor", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.10.5", "mockall", "mysten-common", @@ -9655,7 +9606,7 @@ dependencies = [ "anemo", "fastcrypto", "fdlimit", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.10.5", "mysten-metrics", "mysten-network", @@ -9695,7 +9646,7 @@ dependencies = [ "enum_dispatch", "fastcrypto", "futures", - "indexmap 2.4.0", + "indexmap 2.5.0", "mockall", "mysten-common", "mysten-metrics", @@ -9708,7 +9659,7 @@ dependencies = [ "prometheus", "proptest", "proptest-derive", - "prost 0.13.1", + "prost 0.13.2", "rand 0.8.5", "roaring", "serde", @@ -10166,7 +10117,7 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -10178,7 +10129,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -10204,7 +10155,7 @@ checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", "hashbrown 0.14.5", - "indexmap 2.4.0", + "indexmap 2.5.0", "memchr", ] @@ -10327,7 +10278,7 @@ name = "openapiv3" version = "2.0.0" source = "git+https://github.com/bmwill/openapiv3.git?rev=ca4b4845b7c159a39f5c68ad8f7f76cb6f4d6963#ca4b4845b7c159a39f5c68ad8f7f76cb6f4d6963" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "schemars", "serde", "serde_json", @@ -10357,7 +10308,7 @@ checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" dependencies = [ "futures-core", "futures-sink", - "indexmap 2.4.0", + "indexmap 2.5.0", "js-sys", "once_cell", "pin-project-lite", @@ -10500,7 +10451,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -10514,7 +10465,7 @@ dependencies = [ "proc-macro2 1.0.86", "proc-macro2-diagnostics", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -10627,9 +10578,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -10796,7 +10747,7 @@ dependencies = [ "ciborium", "coset", "data-encoding", - "indexmap 2.4.0", + "indexmap 2.5.0", "rand 0.8.5", "serde", "serde_json", @@ -10927,9 +10878,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -10938,9 +10889,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" dependencies = [ "pest", "pest_generator", @@ -10948,22 +10899,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" dependencies = [ "once_cell", "pest", @@ -10987,7 +10938,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.4.0", + "indexmap 2.5.0", ] [[package]] @@ -11040,7 +10991,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -11078,7 +11029,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -11100,7 +11051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.1", + "fastrand", "futures-io", ] @@ -11155,9 +11106,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -11168,35 +11119,19 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - [[package]] name = "polling" version = "3.7.3" @@ -11207,7 +11142,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.35", + "rustix", "tracing", "windows-sys 0.59.0", ] @@ -11359,7 +11294,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2 1.0.86", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -11480,7 +11415,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", "version_check", "yansi 1.0.1", ] @@ -11587,12 +11522,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" dependencies = [ "bytes", - "prost-derive 0.13.1", + "prost-derive 0.13.2", ] [[package]] @@ -11619,9 +11554,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" +checksum = "f8650aabb6c35b860610e9cff5dc1af886c9e25073b7b1712a68972af4281302" dependencies = [ "bytes", "heck 0.5.0", @@ -11631,10 +11566,10 @@ dependencies = [ "once_cell", "petgraph 0.6.5", "prettyplease 0.2.22", - "prost 0.13.1", - "prost-types 0.13.1", + "prost 0.13.2", + "prost-types 0.13.2", "regex", - "syn 2.0.76", + "syn 2.0.77", "tempfile", ] @@ -11661,20 +11596,20 @@ dependencies = [ "itertools 0.12.1", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" dependencies = [ "anyhow", "itertools 0.13.0", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -11697,11 +11632,11 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "60caa6738c7369b940c3d49246a8d1749323674c65cb13010134f5c9bad5b519" dependencies = [ - "prost 0.13.1", + "prost 0.13.2", ] [[package]] @@ -11715,9 +11650,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" dependencies = [ "cc", ] @@ -11781,9 +11716,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "futures-io", @@ -11800,9 +11735,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", @@ -11817,15 +11752,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2 0.5.7", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -12018,7 +11953,7 @@ checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -12048,15 +11983,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -12094,7 +12020,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -12251,7 +12177,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-util", "ipnet", "js-sys", @@ -12271,14 +12197,14 @@ dependencies = [ "sync_wrapper 1.0.1", "tokio", "tokio-rustls 0.26.0", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", "windows-registry", ] @@ -12692,7 +12618,7 @@ dependencies = [ "subtle", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", ] [[package]] @@ -12795,29 +12721,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes 1.0.11", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.35" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ "bitflags 2.6.0", "errno", "itoa", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "once_cell", "windows-sys 0.52.0", ] @@ -12900,6 +12812,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.3", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -13049,11 +12974,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -13087,7 +13012,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "serde_derive_internals", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -13233,9 +13158,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -13283,13 +13208,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -13300,16 +13225,16 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "itoa", "memchr", "ryu", @@ -13334,7 +13259,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -13393,7 +13318,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -13410,7 +13335,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -13422,7 +13347,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -13443,7 +13368,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "itoa", "ryu", "serde", @@ -13482,7 +13407,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -14109,7 +14034,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "rustversion", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -14122,7 +14047,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "rustversion", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -14158,7 +14083,7 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "sui" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anemo", "anyhow", @@ -14229,7 +14154,7 @@ dependencies = [ "sui-package-management", "sui-protocol-config", "sui-replay", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-simulator", "sui-source-validation", "sui-swarm", @@ -14373,7 +14298,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "arrow 52.2.0", @@ -14425,7 +14350,7 @@ dependencies = [ [[package]] name = "sui-analytics-indexer-derive" -version = "1.32.0" +version = "1.32.1" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", @@ -14434,7 +14359,7 @@ dependencies = [ [[package]] name = "sui-archival" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "byteorder", @@ -14542,7 +14467,7 @@ dependencies = [ "sui-macros", "sui-network", "sui-protocol-config", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-simulator", "sui-storage", "sui-surfer", @@ -14553,14 +14478,14 @@ dependencies = [ "telemetry-subscribers", "test-cluster", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", "typed-store", ] [[package]] name = "sui-bridge" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "arc-swap", @@ -14594,7 +14519,7 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-test-transaction-builder", "sui-types", "tap", @@ -14609,7 +14534,7 @@ dependencies = [ [[package]] name = "sui-bridge-cli" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "clap", @@ -14626,7 +14551,7 @@ dependencies = [ "sui-config", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", "telemetry-subscribers", "tokio", @@ -14657,7 +14582,7 @@ dependencies = [ "sui-data-ingestion-core", "sui-indexer-builder", "sui-json-rpc-types", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-test-transaction-builder", "sui-types", "tap", @@ -14669,7 +14594,7 @@ dependencies = [ [[package]] name = "sui-cluster-test" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -14693,7 +14618,7 @@ dependencies = [ "sui-json", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-swarm", "sui-swarm-config", "sui-test-transaction-builder", @@ -14764,7 +14689,7 @@ dependencies = [ "fs_extra", "futures", "im", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.10.5", "jsonrpsee", "lru 0.10.1", @@ -14867,7 +14792,7 @@ dependencies = [ [[package]] name = "sui-data-ingestion" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -14929,7 +14854,7 @@ dependencies = [ [[package]] name = "sui-e2e-tests" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "assert_cmd", @@ -14942,7 +14867,7 @@ dependencies = [ "fastcrypto-zkp", "fs_extra", "futures", - "indexmap 2.4.0", + "indexmap 2.5.0", "insta", "jsonrpsee", "move-binary-format", @@ -14973,7 +14898,7 @@ dependencies = [ "sui-node", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-simulator", "sui-storage", "sui-swarm", @@ -15046,7 +14971,7 @@ dependencies = [ [[package]] name = "sui-faucet" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-recursion", @@ -15065,7 +14990,7 @@ dependencies = [ "sui-config", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", "tap", "telemetry-subscribers", @@ -15102,7 +15027,7 @@ dependencies = [ [[package]] name = "sui-framework-snapshot" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "bcs", @@ -15165,7 +15090,7 @@ dependencies = [ [[package]] name = "sui-graphql-config" -version = "1.32.0" +version = "1.32.1" dependencies = [ "quote 1.0.37", "syn 1.0.109", @@ -15242,7 +15167,7 @@ dependencies = [ "sui-package-resolver", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-swarm-config", "sui-test-transaction-builder", "sui-types", @@ -15252,7 +15177,7 @@ dependencies = [ "test-cluster", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "toml 0.7.8", "tower", "tower-http", @@ -15282,7 +15207,7 @@ dependencies = [ [[package]] name = "sui-indexer" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -15325,7 +15250,7 @@ dependencies = [ "sui-package-resolver", "sui-protocol-config", "sui-rest-api", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-test-transaction-builder", "sui-transaction-builder", "sui-types", @@ -15335,7 +15260,7 @@ dependencies = [ "test-cluster", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", "url", ] @@ -15391,7 +15316,7 @@ dependencies = [ "futures", "http-body 0.4.6", "hyper 1.4.1", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.10.5", "jsonrpsee", "mockall", @@ -15423,7 +15348,7 @@ dependencies = [ "telemetry-subscribers", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower", "tower-http", "tracing", @@ -15475,7 +15400,7 @@ dependencies = [ "sui-open-rpc", "sui-open-rpc-macros", "sui-protocol-config", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-simulator", "sui-swarm-config", "sui-test-transaction-builder", @@ -15536,7 +15461,7 @@ dependencies = [ [[package]] name = "sui-light-client" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -15553,7 +15478,7 @@ dependencies = [ "sui-json-rpc-types", "sui-package-resolver", "sui-rest-api", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", "tokio", ] @@ -15570,7 +15495,7 @@ dependencies = [ [[package]] name = "sui-metric-checker" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "backoff", @@ -15591,7 +15516,7 @@ dependencies = [ [[package]] name = "sui-move" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "assert_cmd", @@ -15633,7 +15558,7 @@ dependencies = [ [[package]] name = "sui-move-build" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "datatest-stable", @@ -15657,7 +15582,7 @@ dependencies = [ [[package]] name = "sui-move-lsp" -version = "1.32.0" +version = "1.32.1" dependencies = [ "bin-version", "clap", @@ -15674,7 +15599,7 @@ dependencies = [ "fastcrypto", "fastcrypto-vdf", "fastcrypto-zkp", - "indexmap 2.4.0", + "indexmap 2.5.0", "move-binary-format", "move-core-types", "move-stdlib-natives", @@ -15735,7 +15660,7 @@ dependencies = [ "better_any", "fastcrypto", "fastcrypto-zkp", - "indexmap 2.4.0", + "indexmap 2.5.0", "move-binary-format", "move-core-types", "move-stdlib-natives-v2", @@ -15787,7 +15712,7 @@ dependencies = [ [[package]] name = "sui-node" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anemo", "anemo-tower", @@ -15840,7 +15765,7 @@ dependencies = [ [[package]] name = "sui-open-rpc" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "bcs", @@ -15876,7 +15801,7 @@ dependencies = [ [[package]] name = "sui-oracle" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "bcs", @@ -15896,7 +15821,7 @@ dependencies = [ "sui-json-rpc-types", "sui-keys", "sui-move-build", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", "tap", "telemetry-subscribers", @@ -15906,7 +15831,7 @@ dependencies = [ [[package]] name = "sui-package-dump" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "bcs", @@ -15923,14 +15848,14 @@ dependencies = [ [[package]] name = "sui-package-management" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "move-core-types", "move-package", "move-symbol-pool", "sui-json-rpc-types", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", "thiserror", "tracing", @@ -15968,7 +15893,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "sui-enum-compat-util", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -16016,8 +15941,8 @@ dependencies = [ "mysten-metrics", "once_cell", "prometheus", - "prost 0.13.1", - "prost-build 0.13.1", + "prost 0.13.2", + "prost-build 0.13.2", "protobuf", "rand 0.8.5", "reqwest 0.12.7", @@ -16073,7 +15998,7 @@ dependencies = [ "sui-json-rpc-api", "sui-json-rpc-types", "sui-protocol-config", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-storage", "sui-transaction-checks", "sui-types", @@ -16081,7 +16006,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", ] @@ -16118,7 +16043,7 @@ dependencies = [ [[package]] name = "sui-rosetta" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -16146,7 +16071,7 @@ dependencies = [ "sui-keys", "sui-move-build", "sui-node", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-swarm-config", "sui-types", "telemetry-subscribers", @@ -16160,7 +16085,7 @@ dependencies = [ [[package]] name = "sui-rpc-loadgen" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -16178,7 +16103,7 @@ dependencies = [ "sui-json-rpc", "sui-json-rpc-types", "sui-keys", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", "telemetry-subscribers", "test-cluster", @@ -16209,7 +16134,7 @@ dependencies = [ [[package]] name = "sui-sdk" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-recursion", @@ -16245,7 +16170,7 @@ dependencies = [ [[package]] name = "sui-security-watchdog" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "arrow-array 52.2.0", @@ -16292,7 +16217,7 @@ dependencies = [ [[package]] name = "sui-single-node-benchmark" -version = "1.32.0" +version = "1.32.1" dependencies = [ "async-trait", "bcs", @@ -16355,7 +16280,7 @@ dependencies = [ [[package]] name = "sui-source-validation" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "colored", @@ -16373,7 +16298,7 @@ dependencies = [ "sui-json-rpc-types", "sui-move-build", "sui-package-management", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-test-transaction-builder", "sui-types", "tar", @@ -16409,7 +16334,7 @@ dependencies = [ "sui-json-rpc-types", "sui-move", "sui-move-build", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-source-validation", "telemetry-subscribers", "tempfile", @@ -16441,7 +16366,7 @@ dependencies = [ "fastcrypto", "futures", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "indicatif", "integer-encoding", "itertools 0.10.5", @@ -16480,13 +16405,13 @@ dependencies = [ [[package]] name = "sui-surfer" -version = "1.32.0" +version = "1.32.1" dependencies = [ "async-trait", "bcs", "clap", "futures", - "indexmap 2.4.0", + "indexmap 2.5.0", "move-binary-format", "move-core-types", "move-package", @@ -16578,13 +16503,13 @@ dependencies = [ "shared-crypto", "sui-genesis-builder", "sui-move-build", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-types", ] [[package]] name = "sui-test-validator" -version = "1.32.0" +version = "1.32.1" [[package]] name = "sui-tls" @@ -16609,7 +16534,7 @@ dependencies = [ [[package]] name = "sui-tool" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anemo", "anemo-cli", @@ -16643,7 +16568,7 @@ dependencies = [ "sui-package-dump", "sui-protocol-config", "sui-replay", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-snapshot", "sui-storage", "sui-types", @@ -16755,7 +16680,7 @@ dependencies = [ "fastcrypto-tbls", "fastcrypto-zkp", "im", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.10.5", "jsonrpsee", "lru 0.10.1", @@ -16895,7 +16820,7 @@ dependencies = [ [[package]] name = "suins-indexer" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "async-trait", @@ -16929,7 +16854,7 @@ dependencies = [ [[package]] name = "suiop-cli" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "axum 0.7.5", @@ -16964,9 +16889,9 @@ dependencies = [ [[package]] name = "supports-color" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f" +checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" dependencies = [ "is_ci", ] @@ -17005,9 +16930,9 @@ dependencies = [ [[package]] name = "symbolic-common" -version = "12.10.1" +version = "12.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1944ea8afd197111bca0c0edea1e1f56abb3edd030e240c1035cc0e3ff51fec" +checksum = "9c1db5ac243c7d7f8439eb3b8f0357888b37cf3732957e91383b0ad61756374e" dependencies = [ "debugid", "memmap2 0.9.4", @@ -17017,9 +16942,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.10.1" +version = "12.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddaccaf1bf8e73c4f64f78dbb30aadd6965c71faa4ff3fba33f8d7296cf94a87" +checksum = "ea26e430c27d4a8a5dea4c4b81440606c7c1a415bd611451ef6af8c81416afc3" dependencies = [ "cpp_demangle 0.4.4", "rustc-demangle", @@ -17050,9 +16975,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", @@ -17132,8 +17057,8 @@ dependencies = [ "cap-fs-ext", "cap-std", "fd-lock 4.0.2", - "io-lifetimes 2.0.3", - "rustix 0.38.35", + "io-lifetimes", + "rustix", "windows-sys 0.52.0", "winx", ] @@ -17248,9 +17173,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand", "once_cell", - "rustix 0.38.35", + "rustix", "windows-sys 0.59.0", ] @@ -17329,7 +17254,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.35", + "rustix", "windows-sys 0.48.0", ] @@ -17363,7 +17288,7 @@ dependencies = [ "sui-macros", "sui-node", "sui-protocol-config", - "sui-sdk 1.32.0", + "sui-sdk 1.32.1", "sui-simulator", "sui-swarm", "sui-swarm-config", @@ -17411,7 +17336,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "subprocess", - "syn 2.0.76", + "syn 2.0.77", "test-fuzz-internal", "toolchain_find", ] @@ -17458,7 +17383,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -17579,9 +17504,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -17628,7 +17553,7 @@ source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=e47aafebf9 dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -17639,7 +17564,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -17698,14 +17623,14 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", ] [[package]] @@ -17754,9 +17679,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -17784,7 +17709,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime 0.6.8", @@ -17848,7 +17773,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime 0.6.8", @@ -17861,7 +17786,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime 0.6.8", @@ -17947,7 +17872,7 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "prost 0.13.1", + "prost 0.13.2", "socket2 0.5.7", "tokio", "tokio-stream", @@ -17978,9 +17903,9 @@ checksum = "fe4ee8877250136bd7e3d2331632810a4df4ea5e004656990d8d66d2f5ee8a67" dependencies = [ "prettyplease 0.2.22", "proc-macro2 1.0.86", - "prost-build 0.13.1", + "prost-build 0.13.2", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -17990,7 +17915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0a34e6f706bae26b2b490e1da5c3f6a6ff87cae442bcbc7c881bab9631b5a7" dependencies = [ "async-stream", - "prost 0.13.1", + "prost 0.13.2", "tokio", "tokio-stream", "tonic 0.12.2", @@ -18024,7 +17949,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower-layer", "tower-service", "tracing", @@ -18053,7 +17978,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower", "tower-layer", "tower-service", @@ -18105,7 +18030,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -18394,7 +18319,7 @@ dependencies = [ "quote 1.0.37", "regex", "regex-syntax 0.7.5", - "syn 2.0.76", + "syn 2.0.77", "zstd-sys", ] @@ -18423,7 +18348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f" dependencies = [ "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -18563,7 +18488,7 @@ dependencies = [ "rustls 0.23.12", "rustls-pki-types", "url", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -18702,12 +18627,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -18753,10 +18672,10 @@ dependencies = [ "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "log", "once_cell", - "rustix 0.38.35", + "rustix", "system-interface", "thiserror", "tracing", @@ -18793,7 +18712,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -18850,7 +18769,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -19049,7 +18968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ "bitflags 2.6.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "semver", ] @@ -19078,7 +18997,7 @@ dependencies = [ "encoding_rs", "fxprof-processed-profile", "gimli 0.28.1", - "indexmap 2.4.0", + "indexmap 2.5.0", "ittapi", "libc", "log", @@ -19086,7 +19005,7 @@ dependencies = [ "once_cell", "paste", "rayon", - "rustix 0.38.35", + "rustix", "serde", "serde_derive", "serde_json", @@ -19127,7 +19046,7 @@ dependencies = [ "bincode", "directories-next", "log", - "rustix 0.38.35", + "rustix", "serde", "serde_derive", "sha2 0.10.8", @@ -19145,7 +19064,7 @@ dependencies = [ "anyhow", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -19209,7 +19128,7 @@ dependencies = [ "cpp_demangle 0.3.5", "cranelift-entity 0.105.4", "gimli 0.28.1", - "indexmap 2.4.0", + "indexmap 2.5.0", "log", "object", "rustc-demangle", @@ -19233,7 +19152,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "rustix 0.38.35", + "rustix", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.52.0", @@ -19247,7 +19166,7 @@ checksum = "4b0462a46b80d2352ee553b17d626b6468e9cec2220cc58ac31754fd7b58245e" dependencies = [ "object", "once_cell", - "rustix 0.38.35", + "rustix", "wasmtime-versioned-export-macros", ] @@ -19272,7 +19191,7 @@ dependencies = [ "cc", "cfg-if", "encoding_rs", - "indexmap 2.4.0", + "indexmap 2.5.0", "libc", "log", "mach", @@ -19280,7 +19199,7 @@ dependencies = [ "memoffset 0.9.1", "paste", "psm", - "rustix 0.38.35", + "rustix", "sptr", "wasm-encoder 0.41.2", "wasmtime-asm-macros", @@ -19313,7 +19232,7 @@ checksum = "5399c175ddba4a471b9da45105dea3493059d52b2d54860eadb0df04c813948d" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -19334,10 +19253,10 @@ dependencies = [ "fs-set-times", "futures", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "log", "once_cell", - "rustix 0.38.35", + "rustix", "system-interface", "thiserror", "tokio", @@ -19374,7 +19293,7 @@ checksum = "6945fc6cfee04ba81016e9723bea77a2b913108e03904a4d901daedf208365f5" dependencies = [ "anyhow", "heck 0.4.1", - "indexmap 2.4.0", + "indexmap 2.5.0", "wit-parser", ] @@ -19452,9 +19371,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -19468,16 +19387,16 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.35", + "rustix", ] [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall 0.5.3", "wasite", "web-sys", ] @@ -19514,7 +19433,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "shellexpand 2.1.2", - "syn 2.0.76", + "syn 2.0.77", "witx", ] @@ -19526,7 +19445,7 @@ checksum = "93e43fc332703d1ec3aa86a5ce8bb49e6b95b6c617b90e726d3e70a0f70f48a5" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", "wiggle-generate", ] @@ -19853,7 +19772,7 @@ checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" dependencies = [ "anyhow", "id-arena", - "indexmap 2.4.0", + "indexmap 2.5.0", "log", "semver", "serde", @@ -19910,7 +19829,7 @@ dependencies = [ [[package]] name = "x" -version = "1.32.0" +version = "1.32.1" dependencies = [ "anyhow", "camino", @@ -19944,15 +19863,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.14", - "rustix 0.38.35", + "linux-raw-sys", + "rustix", ] [[package]] name = "xml-rs" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" [[package]] name = "xmlparser" @@ -20037,7 +19956,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -20057,7 +19976,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c2d8ab6c2fd85..976cf8b9be6e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -201,7 +201,7 @@ members = [ [workspace.package] # This version string will be inherited by sui-core, sui-faucet, sui-node, sui-tools, sui-sdk, sui-move-build, and sui crates. -version = "1.32.0" +version = "1.32.1" [profile.release] # debug = 1 means line charts only, which is minimum needed for good stack traces @@ -374,6 +374,7 @@ jsonrpsee = { git = "https://github.com/wlmyng/jsonrpsee.git", rev = "b1b3007847 json_to_table = { git = "https://github.com/zhiburt/tabled/", rev = "e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4" } leb128 = "0.2.5" lru = "0.10" +markdown-gen = "1.2.1" match_opt = "0.1.2" miette = { version = "7", features = ["fancy"] } mime = "0.3" @@ -504,6 +505,7 @@ tower-http = { version = "0.5", features = [ "set-header", "propagate-header", ] } +# tower-http = { version="0.4", features = ["trace"] } tower-layer = "0.3.2" twox-hash = "1.6.3" tracing = "0.1.37" @@ -607,6 +609,7 @@ sui-authority-aggregation = { path = "crates/sui-authority-aggregation" } sui-benchmark = { path = "crates/sui-benchmark" } sui-bridge = { path = "crates/sui-bridge" } sui-cluster-test = { path = "crates/sui-cluster-test" } +sui-common = { path = "crates/sui-common" } sui-config = { path = "crates/sui-config" } sui-core = { path = "crates/sui-core" } sui-cost = { path = "crates/sui-cost" } @@ -674,6 +677,7 @@ telemetry-subscribers = { path = "crates/telemetry-subscribers" } test-cluster = { path = "crates/test-cluster" } transaction-fuzzer = { path = "crates/transaction-fuzzer" } typed-store = { path = "crates/typed-store" } +typed-store-derive = { path = "crates/typed-store-derive" } typed-store-error = { path = "crates/typed-store-error" } x = { path = "crates/x" } diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index b101ca281321a..51ebe8da17f72 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -5530,6 +5530,7 @@ impl NodeStateDump { Ok(path) } + #[cfg(not(release))] pub fn read_from_file(path: &PathBuf) -> Result { let file = File::open(path)?; serde_json::from_reader(file).map_err(|e| anyhow::anyhow!(e)) diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.exp new file mode 100644 index 0000000000000..2e134867efbdc --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.exp @@ -0,0 +1,43 @@ +processed 5 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1, lines 9-28: +//# publish +created: object(1,0) +mutated: object(0,2) +gas summary: computation_cost: 1000000, storage_cost: 5380800, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2, line 30: +//# run Test::M2::emit_emit_a --sender A --args 20 +events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [20, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 3, line 32: +//# create-checkpoint +Checkpoint created: 1 + +task 4, lines 34-51: +//# run-graphql +Response: { + "data": null, + "errors": [ + { + "message": "Filtering by both emitting module and event type is not supported", + "locations": [ + { + "line": 2, + "column": 3 + } + ], + "path": [ + "events" + ], + "extensions": { + "code": "BAD_USER_INPUT" + } + } + ] +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.move b/crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.move new file mode 100644 index 0000000000000..ad38316463e76 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.move @@ -0,0 +1,51 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// Tests that fetching events filtered on both emitting module and event would result +// in an error. + +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator + +//# publish +module Test::M1 { + use sui::event; + + public struct EventA has copy, drop { + new_value: u64 + } + + public fun emit_a(value: u64) { + event::emit(EventA { new_value: value }) + } +} + +module Test::M2 { + use Test::M1; + + public fun emit_emit_a(value: u64) { + M1::emit_a(value); + } +} + +//# run Test::M2::emit_emit_a --sender A --args 20 + +//# create-checkpoint + +//# run-graphql +{ + events(filter: {sender: "@{A}", emittingModule: "@{Test}::M2", eventType: "@{Test}::M1::EventA"}) { + nodes { + sendingModule { + name + } + type { + repr + } + sender { + address + } + json + bcs + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.exp new file mode 100644 index 0000000000000..3d916fe5b9508 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.exp @@ -0,0 +1,254 @@ +processed 6 tasks + +init: +A: object(0,0) + +task 1, lines 6-25: +//# publish +created: object(1,0) +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 4970400, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2, line 27: +//# run Test::M1::emit --sender A --args 0 +events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [1, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [2, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [3, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [4, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [5, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [6, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [7, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [8, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [9, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [10, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [11, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [12, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [13, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [14, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [15, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [16, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [17, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [18, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [19, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [20, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [21, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [22, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [23, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [24, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [25, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [26, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [27, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [28, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [29, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [30, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [31, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [32, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [33, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [34, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [35, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [36, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [37, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [38, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [39, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [40, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [41, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [42, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [43, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [44, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [45, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [46, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [47, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [48, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [49, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [50, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 3, line 29: +//# create-checkpoint +Checkpoint created: 1 + +task 4, lines 31-44: +//# run-graphql +Response: { + "data": { + "events": { + "pageInfo": { + "hasPreviousPage": false, + "hasNextPage": true, + "startCursor": "eyJ0eCI6MiwiZSI6MCwiYyI6MX0", + "endCursor": "eyJ0eCI6MiwiZSI6MTksImMiOjF9" + }, + "nodes": [ + { + "json": { + "new_value": "0" + } + }, + { + "json": { + "new_value": "1" + } + }, + { + "json": { + "new_value": "2" + } + }, + { + "json": { + "new_value": "3" + } + }, + { + "json": { + "new_value": "4" + } + }, + { + "json": { + "new_value": "5" + } + }, + { + "json": { + "new_value": "6" + } + }, + { + "json": { + "new_value": "7" + } + }, + { + "json": { + "new_value": "8" + } + }, + { + "json": { + "new_value": "9" + } + }, + { + "json": { + "new_value": "10" + } + }, + { + "json": { + "new_value": "11" + } + }, + { + "json": { + "new_value": "12" + } + }, + { + "json": { + "new_value": "13" + } + }, + { + "json": { + "new_value": "14" + } + }, + { + "json": { + "new_value": "15" + } + }, + { + "json": { + "new_value": "16" + } + }, + { + "json": { + "new_value": "17" + } + }, + { + "json": { + "new_value": "18" + } + }, + { + "json": { + "new_value": "19" + } + } + ] + } + } +} + +task 5, lines 46-59: +//# run-graphql --cursors {"tx":2,"e":19,"c":1} +Response: { + "data": { + "events": { + "pageInfo": { + "hasPreviousPage": true, + "hasNextPage": true, + "startCursor": "eyJ0eCI6MiwiZSI6MjAsImMiOjF9", + "endCursor": "eyJ0eCI6MiwiZSI6MzksImMiOjF9" + }, + "nodes": [ + { + "json": { + "new_value": "20" + } + }, + { + "json": { + "new_value": "21" + } + }, + { + "json": { + "new_value": "22" + } + }, + { + "json": { + "new_value": "23" + } + }, + { + "json": { + "new_value": "24" + } + }, + { + "json": { + "new_value": "25" + } + }, + { + "json": { + "new_value": "26" + } + }, + { + "json": { + "new_value": "27" + } + }, + { + "json": { + "new_value": "28" + } + }, + { + "json": { + "new_value": "29" + } + }, + { + "json": { + "new_value": "30" + } + }, + { + "json": { + "new_value": "31" + } + }, + { + "json": { + "new_value": "32" + } + }, + { + "json": { + "new_value": "33" + } + }, + { + "json": { + "new_value": "34" + } + }, + { + "json": { + "new_value": "35" + } + }, + { + "json": { + "new_value": "36" + } + }, + { + "json": { + "new_value": "37" + } + }, + { + "json": { + "new_value": "38" + } + }, + { + "json": { + "new_value": "39" + } + } + ] + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.move b/crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.move new file mode 100644 index 0000000000000..aaca18be1a12a --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/no_filter.move @@ -0,0 +1,59 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +//# init --protocol-version 48 --addresses Test=0x0 --accounts A --simulator + +//# publish +module Test::M1 { + use sui::event; + + public struct EventA has copy, drop { + new_value: u64 + } + + public entry fun no_emit(value: u64): u64 { + value + } + + public entry fun emit(value: u64) { + let mut i = 0; + while (i < 51) { + event::emit(EventA { new_value: value + i }); + i = i + 1; + } + } +} + +//# run Test::M1::emit --sender A --args 0 + +//# create-checkpoint + +//# run-graphql +{ + events { + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + nodes { + json + } + } +} + +//# run-graphql --cursors {"tx":2,"e":19,"c":1} +{ + events(after: "@{cursor_0}") { + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + nodes { + json + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.exp new file mode 100644 index 0000000000000..12f3b6c2ebbb3 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.exp @@ -0,0 +1,326 @@ +processed 21 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1, lines 10-26: +//# publish +created: object(1,0) +mutated: object(0,2) +gas summary: computation_cost: 1000000, storage_cost: 4795600, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2, line 28: +//# run Test::M1::no_emit --sender A --args 0 +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 3, line 30: +//# run Test::M1::emit_2 --sender A --args 2 +events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [2, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [3, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 4, line 32: +//# run Test::M1::emit_2 --sender B --args 4 +events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: B, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [4, 0, 0, 0, 0, 0, 0, 0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: B, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [5, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 5, line 34: +//# create-checkpoint +Checkpoint created: 1 + +task 6, lines 36-43: +//# run-graphql +Response: { + "data": { + "transactionBlocks": { + "nodes": [ + { + "digest": "AXoD3PWjAdYov3o7FaWgAqJA8RmvQrjwxGxAi2MNEujz" + }, + { + "digest": "3nuQk9o2VVoqWbF6gS5vBTPwVLhMRbFJREDCvQJUavZ2" + }, + { + "digest": "5VAhspujQVcgJNvqe9Ed8BuFTeZdTRCCTzS6WwSZ9Dke" + }, + { + "digest": "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj" + }, + { + "digest": "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v" + } + ] + } + } +} + +task 7, lines 45-55: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6MywiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "2" + } + } + }, + { + "cursor": "eyJ0eCI6MywiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "3" + } + } + } + ] + } + } +} + +task 8, lines 57-68: +//# run-graphql --cursors {"tx":3,"e":1,"c":1} +Response: { + "data": { + "events": { + "edges": [] + } + } +} + +task 9, lines 70-83: +//# run-graphql --cursors {"tx":1,"e":1,"c":1} +Response: { + "data": { + "events": { + "edges": [] + } + } +} + +task 10, lines 86-96: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6NCwiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "4" + } + } + }, + { + "cursor": "eyJ0eCI6NCwiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "5" + } + } + } + ] + } + } +} + +task 11, lines 98-108: +//# run-graphql --cursors {"tx":4,"e":0,"c":1} +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6NCwiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "5" + } + } + } + ] + } + } +} + +task 12, lines 111-121: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6MywiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "2" + } + } + }, + { + "cursor": "eyJ0eCI6MywiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "3" + } + } + } + ] + } + } +} + +task 13, lines 123-134: +//# run-graphql --cursors {"tx":3,"e":1,"c":1} +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6MywiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "2" + } + } + } + ] + } + } +} + +task 14, lines 136-149: +//# run-graphql --cursors {"tx":4,"e":1,"c":1} +Response: { + "data": { + "events": { + "edges": [] + } + } +} + +task 15, lines 152-162: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6NCwiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "4" + } + } + }, + { + "cursor": "eyJ0eCI6NCwiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "5" + } + } + } + ] + } + } +} + +task 16, lines 164-174: +//# run-graphql --cursors {"tx":4,"e":1,"c":1} +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6NCwiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "4" + } + } + } + ] + } + } +} + +task 17, lines 176-187: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6MywiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "2" + } + } + }, + { + "cursor": "eyJ0eCI6MywiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "3" + } + } + } + ] + } + } +} + +task 18, lines 189-200: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [ + { + "cursor": "eyJ0eCI6NCwiZSI6MCwiYyI6MX0", + "node": { + "json": { + "new_value": "4" + } + } + }, + { + "cursor": "eyJ0eCI6NCwiZSI6MSwiYyI6MX0", + "node": { + "json": { + "new_value": "5" + } + } + } + ] + } + } +} + +task 19, lines 202-213: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [] + } + } +} + +task 20, lines 215-226: +//# run-graphql +Response: { + "data": { + "events": { + "edges": [] + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.move b/crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.move new file mode 100644 index 0000000000000..58b17e5fd21d8 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/tx_digest.move @@ -0,0 +1,226 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// Tests that fetching events filtered on a tx digest that has no events correctly returns no nodes. +// Also tests that fetching events filtered on a tx digest that has events returns the correct +// number of page-limit-bound nodes. + +//# init --protocol-version 48 --addresses Test=0x0 --accounts A B --simulator + +//# publish +module Test::M1 { + use sui::event; + + public struct EventA has copy, drop { + new_value: u64 + } + + public entry fun no_emit(value: u64): u64 { + value + } + + public entry fun emit_2(value: u64) { + event::emit(EventA { new_value: value }); + event::emit(EventA { new_value: value + 1}) + } +} + +//# run Test::M1::no_emit --sender A --args 0 + +//# run Test::M1::emit_2 --sender A --args 2 + +//# run Test::M1::emit_2 --sender B --args 4 + +//# create-checkpoint + +//# run-graphql +{ + transactionBlocks { + nodes { + digest + } + } +} + +//# run-graphql +{ + events(filter: {transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql --cursors {"tx":3,"e":1,"c":1} +# When the tx digest and after cursor are on the same tx, we'll use the after cursor's event sequence number +{ + events(after: "@{cursor_0}" filter: {transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql --cursors {"tx":1,"e":1,"c":1} +# If the after cursor does not match the transaction digest's tx sequence number, +# we will get an empty response, since it's not possible to fetch an event +# that isn't of the same tx sequence number +{ + events(after: "@{cursor_0}" filter: {transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + + +//# run-graphql +{ + events(filter: {transactionDigest: "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql --cursors {"tx":4,"e":0,"c":1} +{ + events(after: "@{cursor_0}" filter: {transactionDigest: "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v"}) { + edges { + cursor + node { + json + } + } + } +} + + +//# run-graphql +{ + events(last: 10 filter: {transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql --cursors {"tx":3,"e":1,"c":1} +# When the tx digest and cursor are on the same tx, we'll use the cursor's event sequence number +{ + events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql --cursors {"tx":4,"e":1,"c":1} +# If the cursor does not match the transaction digest's tx sequence number, +# we will get an empty response, since it's not possible to fetch an event +# that isn't of the same tx sequence number +{ + events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + + +//# run-graphql +{ + events(last: 10 filter: {transactionDigest: "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql --cursors {"tx":4,"e":1,"c":1} +{ + events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql +# correct sender +{ + events(filter: {sender: "@{A}" transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql +# correct sender +{ + events(filter: {sender: "@{B}" transactionDigest: "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql +# incorrect sender +{ + events(filter: {sender: "@{B}" transactionDigest: "8n1pk5fYM7v7tvsh4dcKxLRy8uf3he24FZCwdEKi9cSj"}) { + edges { + cursor + node { + json + } + } + } +} + +//# run-graphql +# incorrect sender +{ + events(filter: {sender: "@{A}" transactionDigest: "4dqR1zeomDMNHbUAZjooSZXrosPEb67gvvsUFeUSet9v"}) { + edges { + cursor + node { + json + } + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.exp new file mode 100644 index 0000000000000..3afb31848780e --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.exp @@ -0,0 +1,211 @@ +processed 12 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1, lines 6-34: +//# publish +created: object(1,0) +mutated: object(0,2) +gas summary: computation_cost: 1000000, storage_cost: 6604400, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2, line 36: +//# run Test::M2::emit_emit_a --sender A --args 20 +events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [20, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 3, line 38: +//# create-checkpoint +Checkpoint created: 1 + +task 4, lines 40-57: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M1::EventA" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "20" + }, + "bcs": "FAAAAAAAAAA=" + } + ] + } + } +} + +task 5, line 59: +//# run Test::M2::emit_b --sender A --args 42 +events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: A, type_: StructTag { address: Test, module: Identifier("M2"), name: Identifier("EventB"), type_params: [] }, contents: [42, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 6, line 61: +//# run Test::M2::emit_b --sender B --args 43 +events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: B, type_: StructTag { address: Test, module: Identifier("M2"), name: Identifier("EventB"), type_params: [] }, contents: [43, 0, 0, 0, 0, 0, 0, 0] } +mutated: object(0,1) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 7, line 63: +//# create-checkpoint +Checkpoint created: 2 + +task 8, lines 65-82: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M1::EventA" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "20" + }, + "bcs": "FAAAAAAAAAA=" + } + ] + } + } +} + +task 9, lines 84-101: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M2::EventB" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "42" + }, + "bcs": "KgAAAAAAAAA=" + } + ] + } + } +} + +task 10, lines 103-120: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M1::EventA" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "20" + }, + "bcs": "FAAAAAAAAAA=" + }, + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M2::EventB" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "42" + }, + "bcs": "KgAAAAAAAAA=" + } + ] + } + } +} + +task 11, lines 122-139: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M1::EventA" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "20" + }, + "bcs": "FAAAAAAAAAA=" + }, + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M2::EventB" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "new_value": "42" + }, + "bcs": "KgAAAAAAAAA=" + }, + { + "sendingModule": { + "name": "M2" + }, + "type": { + "repr": "0x6edb181eb03cea19a3c4b09d2d6b5de8d0a741df186d072d18b2030eb36faee1::M2::EventB" + }, + "sender": { + "address": "0xa7b032703878aa74c3126935789fd1d4d7e111d5911b09247d6963061c312b5a" + }, + "json": { + "new_value": "43" + }, + "bcs": "KwAAAAAAAAA=" + } + ] + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.move b/crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.move new file mode 100644 index 0000000000000..0ca546a3a94ef --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/type_filter.move @@ -0,0 +1,140 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator + +//# publish +module Test::M1 { + use sui::event; + + public struct EventA has copy, drop { + new_value: u64 + } + + public fun emit_a(value: u64) { + event::emit(EventA { new_value: value }) + } +} + +module Test::M2 { + use sui::event; + use Test::M1; + + public struct EventB has copy, drop { + new_value: u64 + } + + public fun emit_emit_a(value: u64) { + M1::emit_a(value); + } + + public fun emit_b(value: u64) { + event::emit(EventB { new_value: value }) + } +} + +//# run Test::M2::emit_emit_a --sender A --args 20 + +//# create-checkpoint + +//# run-graphql +{ + events(filter: {sender: "@{A}", eventType: "@{Test}::M1::EventA"}) { + nodes { + sendingModule { + name + } + type { + repr + } + sender { + address + } + json + bcs + } + } +} + +//# run Test::M2::emit_b --sender A --args 42 + +//# run Test::M2::emit_b --sender B --args 43 + +//# create-checkpoint + +//# run-graphql +{ + events(filter: {sender: "@{A}", eventType: "@{Test}::M1"}) { + nodes { + sendingModule { + name + } + type { + repr + } + sender { + address + } + json + bcs + } + } +} + +//# run-graphql +{ + events(filter: {sender: "@{A}", eventType: "@{Test}::M2"}) { + nodes { + sendingModule { + name + } + type { + repr + } + sender { + address + } + json + bcs + } + } +} + +//# run-graphql +{ + events(filter: {sender: "@{A}", eventType: "@{Test}"}) { + nodes { + sendingModule { + name + } + type { + repr + } + sender { + address + } + json + bcs + } + } +} + +//# run-graphql +{ + events(filter: {eventType: "@{Test}"}) { + nodes { + sendingModule { + name + } + type { + repr + } + sender { + address + } + json + bcs + } + } +} + diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.exp b/crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.exp new file mode 100644 index 0000000000000..383af1455f8f3 --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.exp @@ -0,0 +1,182 @@ +processed 10 tasks + +init: +A: object(0,0), B: object(0,1) + +task 1, lines 6-29: +//# publish +created: object(1,0) +mutated: object(0,2) +gas summary: computation_cost: 1000000, storage_cost: 5996400, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 2, line 32: +//# run Test::M1::emit_T1 --sender A +events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [Struct(StructTag { address: Test, module: Identifier("M1"), name: Identifier("T1"), type_params: [] })] }, contents: [0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 + +task 3, line 34: +//# run Test::M1::emit_T2 --sender A +events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [Struct(StructTag { address: Test, module: Identifier("M1"), name: Identifier("T2"), type_params: [] })] }, contents: [0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 4, line 36: +//# run Test::M1::emit_both --sender A +events: Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [Struct(StructTag { address: Test, module: Identifier("M1"), name: Identifier("T1"), type_params: [] })] }, contents: [0] }, Event { package_id: Test, transaction_module: Identifier("M1"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [Struct(StructTag { address: Test, module: Identifier("M1"), name: Identifier("T2"), type_params: [] })] }, contents: [0] } +mutated: object(0,0) +gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 978120, non_refundable_storage_fee: 9880 + +task 5, line 38: +//# create-checkpoint +Checkpoint created: 1 + +task 6, lines 40-47: +//# run-graphql +Response: { + "data": { + "transactionBlocks": { + "nodes": [ + { + "digest": "J7mHXcoa7LXwyjzZUWsk8zvYZjek359TM4d2hQK4LGHo" + }, + { + "digest": "Ch3i5cdtNPU5v8oSg3V5cdKtZDa3YjqjMd7Qh4NQLAx6" + }, + { + "digest": "6taTf6v2NQCFtd9A4nw3mBbkHwUw8RUoJjqQGSB5cBNt" + }, + { + "digest": "AEXpVZ7Vpsk7ZSTsR2QNPT7zhq8oqpJXRGgx3kAaTdn" + }, + { + "digest": "9nu1ivpL9hHcbJ9GwGfmD3Kuet5w74t2GBp8f1Ggy3UD" + } + ] + } + } +} + +task 7, lines 49-62: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T1>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + }, + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T2>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + }, + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T1>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + }, + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T2>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + } + ] + } + } +} + +task 8, lines 64-77: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T1>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + }, + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T1>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + } + ] + } + } +} + +task 9, lines 79-92: +//# run-graphql +Response: { + "data": { + "events": { + "nodes": [ + { + "type": { + "repr": "0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::EventA<0xe722de9e58a9bab3a202b769b7518f91f852460d3d2c6d6743c301d08b9e614a::M1::T2>" + }, + "sender": { + "address": "0xfccc9a421bbb13c1a66a1aa98f0ad75029ede94857779c6915b44f94068b921e" + }, + "json": { + "value": { + "dummy_field": false + } + } + } + ] + } + } +} diff --git a/crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.move b/crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.move new file mode 100644 index 0000000000000..128362999b50b --- /dev/null +++ b/crates/sui-graphql-e2e-tests/tests/event_connection/type_param_filter.move @@ -0,0 +1,92 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator + +//# publish +module Test::M1 { + use sui::event; + + public struct T1 has copy, drop {} + public struct T2 has copy, drop {} + + public struct EventA has copy, drop { + value: T + } + + public fun emit_T1() { + event::emit(EventA { value: T1 {} }) + } + + public fun emit_T2() { + event::emit(EventA { value: T2 {} }) + } + + public fun emit_both() { + event::emit(EventA { value: T1 {} }); + event::emit(EventA { value: T2 {} }) + } +} + + +//# run Test::M1::emit_T1 --sender A + +//# run Test::M1::emit_T2 --sender A + +//# run Test::M1::emit_both --sender A + +//# create-checkpoint + +//# run-graphql +{ + transactionBlocks { + nodes { + digest + } + } +} + +//# run-graphql +{ + events(filter: {eventType: "@{Test}::M1::EventA"}) { + nodes { + type { + repr + } + sender { + address + } + json + } + } +} + +//# run-graphql +{ + events(filter: {eventType: "@{Test}::M1::EventA<@{Test}::M1::T1>"}) { + nodes { + type { + repr + } + sender { + address + } + json + } + } +} + +//# run-graphql +{ + events(filter: {eventType: "@{Test}::M1::EventA<@{Test}::M1::T2>", transactionDigest: "9nu1ivpL9hHcbJ9GwGfmD3Kuet5w74t2GBp8f1Ggy3UD"}) { + nodes { + type { + repr + } + sender { + address + } + json + } + } +} diff --git a/crates/sui-graphql-rpc/schema.graphql b/crates/sui-graphql-rpc/schema.graphql index defc55cc329d2..faca90cc4e354 100644 --- a/crates/sui-graphql-rpc/schema.graphql +++ b/crates/sui-graphql-rpc/schema.graphql @@ -1272,6 +1272,8 @@ input EventFilter { PTB and emits an event. Modules can be filtered by their package, or package::module. + We currently do not support filtering by emitting module and event type + at the same time so if both are provided in one filter, the query will error. """ emittingModule: String """ @@ -3312,7 +3314,9 @@ type Query { """ transactionBlocks(first: Int, after: String, last: Int, before: String, filter: TransactionBlockFilter, scanLimit: Int): TransactionBlockConnection! """ - The events that exist in the network. + Query events that are emitted in the network. + We currently do not support filtering by emitting module and event type + at the same time so if both are provided in one filter, the query will error. """ events(first: Int, after: String, last: Int, before: String, filter: EventFilter): EventConnection! """ diff --git a/crates/sui-graphql-rpc/src/types/event/cursor.rs b/crates/sui-graphql-rpc/src/types/event/cursor.rs new file mode 100644 index 0000000000000..9a64399f1fab6 --- /dev/null +++ b/crates/sui-graphql-rpc/src/types/event/cursor.rs @@ -0,0 +1,183 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::{ + consistency::Checkpointed, + filter, + raw_query::RawQuery, + types::cursor::{self, Paginated, RawPaginated, ScanLimited, Target}, +}; +use diesel::{ + backend::Backend, + deserialize::{self, FromSql, QueryableByName}, + row::NamedRow, + BoolExpressionMethods, ExpressionMethods, QueryDsl, +}; +use serde::{Deserialize, Serialize}; +use sui_indexer::{models::events::StoredEvent, schema::events}; + +use super::Query; + +/// Contents of an Event's cursor. +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq)] +pub(crate) struct EventKey { + /// Transaction Sequence Number + pub tx: u64, + + /// Event Sequence Number + pub e: u64, + + /// The checkpoint sequence number this was viewed at. + #[serde(rename = "c")] + pub checkpoint_viewed_at: u64, +} + +pub(crate) type Cursor = cursor::JsonCursor; + +/// Results from raw queries in Diesel can only be deserialized into structs that implement +/// `QueryableByName`. This struct is used to represent a row of `tx_sequence_number` and +/// `event_sequence_number` returned from subqueries against event lookup tables. +#[derive(Clone, Debug)] +pub struct EvLookup { + pub tx: i64, + pub ev: i64, +} + +impl Paginated for StoredEvent { + type Source = events::table; + + fn filter_ge(cursor: &Cursor, query: Query) -> Query { + use events::dsl::{event_sequence_number as event, tx_sequence_number as tx}; + query.filter( + tx.gt(cursor.tx as i64) + .or(tx.eq(cursor.tx as i64).and(event.ge(cursor.e as i64))), + ) + } + + fn filter_le(cursor: &Cursor, query: Query) -> Query { + use events::dsl::{event_sequence_number as event, tx_sequence_number as tx}; + query.filter( + tx.lt(cursor.tx as i64) + .or(tx.eq(cursor.tx as i64).and(event.le(cursor.e as i64))), + ) + } + + fn order(asc: bool, query: Query) -> Query { + use events::dsl; + if asc { + query + .order_by(dsl::tx_sequence_number.asc()) + .then_order_by(dsl::event_sequence_number.asc()) + } else { + query + .order_by(dsl::tx_sequence_number.desc()) + .then_order_by(dsl::event_sequence_number.desc()) + } + } +} + +impl RawPaginated for StoredEvent { + fn filter_ge(cursor: &Cursor, query: RawQuery) -> RawQuery { + filter!( + query, + format!( + "ROW(tx_sequence_number, event_sequence_number) >= ({}, {})", + cursor.tx, cursor.e + ) + ) + } + + fn filter_le(cursor: &Cursor, query: RawQuery) -> RawQuery { + filter!( + query, + format!( + "ROW(tx_sequence_number, event_sequence_number) <= ({}, {})", + cursor.tx, cursor.e + ) + ) + } + + fn order(asc: bool, query: RawQuery) -> RawQuery { + if asc { + query.order_by("tx_sequence_number ASC, event_sequence_number ASC") + } else { + query.order_by("tx_sequence_number DESC, event_sequence_number DESC") + } + } +} + +impl Target for StoredEvent { + fn cursor(&self, checkpoint_viewed_at: u64) -> Cursor { + Cursor::new(EventKey { + tx: self.tx_sequence_number as u64, + e: self.event_sequence_number as u64, + checkpoint_viewed_at, + }) + } +} + +impl Checkpointed for Cursor { + fn checkpoint_viewed_at(&self) -> u64 { + self.checkpoint_viewed_at + } +} + +impl ScanLimited for Cursor {} + +impl Target for EvLookup { + fn cursor(&self, checkpoint_viewed_at: u64) -> Cursor { + Cursor::new(EventKey { + tx: self.tx as u64, + e: self.ev as u64, + checkpoint_viewed_at, + }) + } +} + +impl RawPaginated for EvLookup { + fn filter_ge(cursor: &Cursor, query: RawQuery) -> RawQuery { + filter!( + query, + format!( + "ROW(tx_sequence_number, event_sequence_number) >= ({}, {})", + cursor.tx, cursor.e + ) + ) + } + + fn filter_le(cursor: &Cursor, query: RawQuery) -> RawQuery { + filter!( + query, + format!( + "ROW(tx_sequence_number, event_sequence_number) <= ({}, {})", + cursor.tx, cursor.e + ) + ) + } + + fn order(asc: bool, query: RawQuery) -> RawQuery { + if asc { + query.order_by("tx_sequence_number ASC, event_sequence_number ASC") + } else { + query.order_by("tx_sequence_number DESC, event_sequence_number DESC") + } + } +} + +/// `sql_query` raw queries require `QueryableByName`. The default implementation looks for a table +/// based on the struct name, and it also expects the struct's fields to reflect the table's +/// columns. We can override this behavior by implementing `QueryableByName` for our struct. For +/// `EvLookup`, its fields are derived from the common `tx_sequence_number` and +/// `event_sequence_number` columns for all events-related tables. +impl QueryableByName for EvLookup +where + DB: Backend, + i64: FromSql, +{ + fn build<'a>(row: &impl NamedRow<'a, DB>) -> deserialize::Result { + let tx = NamedRow::get::(row, "tx_sequence_number")?; + let ev = NamedRow::get::(row, "event_sequence_number")?; + + Ok(Self { tx, ev }) + } +} diff --git a/crates/sui-graphql-rpc/src/types/event/filter.rs b/crates/sui-graphql-rpc/src/types/event/filter.rs new file mode 100644 index 0000000000000..0a02a31be8969 --- /dev/null +++ b/crates/sui-graphql-rpc/src/types/event/filter.rs @@ -0,0 +1,44 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::types::{ + digest::Digest, + sui_address::SuiAddress, + type_filter::{ModuleFilter, TypeFilter}, +}; +use async_graphql::*; + +#[derive(InputObject, Clone, Default)] +pub(crate) struct EventFilter { + pub sender: Option, + pub transaction_digest: Option, + // Enhancement (post-MVP) + // after_checkpoint + // before_checkpoint + /// Events emitted by a particular module. An event is emitted by a + /// particular module if some function in the module is called by a + /// PTB and emits an event. + /// + /// Modules can be filtered by their package, or package::module. + /// We currently do not support filtering by emitting module and event type + /// at the same time so if both are provided in one filter, the query will error. + pub emitting_module: Option, + + /// This field is used to specify the type of event emitted. + /// + /// Events can be filtered by their type's package, package::module, + /// or their fully qualified type name. + /// + /// Generic types can be queried by either the generic type name, e.g. + /// `0x2::coin::Coin`, or by the full type name, such as + /// `0x2::coin::Coin<0x2::sui::SUI>`. + pub event_type: Option, + // Enhancement (post-MVP) + // pub start_time + // pub end_time + + // Enhancement (post-MVP) + // pub any + // pub all + // pub not +} diff --git a/crates/sui-graphql-rpc/src/types/event/lookups.rs b/crates/sui-graphql-rpc/src/types/event/lookups.rs new file mode 100644 index 0000000000000..93a9a55bf6e6b --- /dev/null +++ b/crates/sui-graphql-rpc/src/types/event/lookups.rs @@ -0,0 +1,158 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use crate::{ + data::pg::bytea_literal, + filter, query, + raw_query::RawQuery, + types::{ + cursor::Page, + digest::Digest, + sui_address::SuiAddress, + type_filter::{ModuleFilter, TypeFilter}, + }, +}; + +use std::fmt::Write; + +use super::Cursor; + +fn select_ev(sender: Option, from: &str) -> RawQuery { + let query = query!(format!( + "SELECT tx_sequence_number, event_sequence_number FROM {}", + from + )); + + if let Some(sender) = sender { + return query.filter(format!("sender = {}", bytea_literal(sender.as_slice()))); + } + + query +} + +pub(crate) fn select_sender(sender: SuiAddress) -> RawQuery { + select_ev(Some(sender), "event_senders") +} + +pub(crate) fn select_event_type(event_type: &TypeFilter, sender: Option) -> RawQuery { + match event_type { + TypeFilter::ByModule(ModuleFilter::ByPackage(p)) => { + filter!( + select_ev(sender, "event_struct_package"), + format!("package = {}", bytea_literal(p.as_slice())) + ) + } + TypeFilter::ByModule(ModuleFilter::ByModule(p, m)) => { + filter!( + select_ev(sender, "event_struct_module"), + format!( + "package = {} and module = {{}}", + bytea_literal(p.as_slice()) + ), + m + ) + } + TypeFilter::ByType(tag) => { + let package = tag.address; + let module = tag.module.to_string(); + let mut name = tag.name.as_str().to_owned(); + let (table, col_name) = if tag.type_params.is_empty() { + ("event_struct_name", "type_name") + } else { + let mut prefix = "<"; + for param in &tag.type_params { + name += prefix; + // SAFETY: write! to String always succeeds. + write!( + name, + "{}", + param.to_canonical_display(/* with_prefix */ true) + ) + .unwrap(); + prefix = ", "; + } + name += ">"; + ("event_struct_instantiation", "type_instantiation") + }; + + filter!( + select_ev(sender, table), + format!( + "package = {} and module = {{}} and {} = {{}}", + bytea_literal(package.as_slice()), + col_name + ), + module, + name + ) + } + } +} + +pub(crate) fn select_emit_module( + emit_module: &ModuleFilter, + sender: Option, +) -> RawQuery { + match emit_module { + ModuleFilter::ByPackage(p) => { + filter!( + select_ev(sender, "event_emit_package"), + format!("package = {}", bytea_literal(p.as_slice())) + ) + } + ModuleFilter::ByModule(p, m) => { + filter!( + select_ev(sender, "event_emit_module"), + format!( + "package = {} and module = {{}}", + bytea_literal(p.as_slice()) + ), + m + ) + } + } +} + +/// Adds filters to bound an events query from above and below based on cursors and filters. The +/// query will always at least be bounded by `tx_hi`, the current exclusive upperbound on +/// transaction sequence numbers, based on the consistency cursor. +pub(crate) fn add_bounds( + mut query: RawQuery, + tx_digest_filter: &Option, + page: &Page, + tx_hi: i64, +) -> RawQuery { + query = filter!(query, format!("tx_sequence_number < {}", tx_hi)); + + if let Some(after) = page.after() { + query = filter!( + query, + format!( + "ROW(tx_sequence_number, event_sequence_number) >= ({}, {})", + after.tx, after.e + ) + ); + } + + if let Some(before) = page.before() { + query = filter!( + query, + format!( + "ROW(tx_sequence_number, event_sequence_number) <= ({}, {})", + before.tx, before.e + ) + ); + } + + if let Some(digest) = tx_digest_filter { + query = filter!( + query, + format!( + "tx_sequence_number = (SELECT tx_sequence_number FROM tx_digests WHERE tx_digest = {})", + bytea_literal(digest.as_slice()), + ) + ); + } + + query +} diff --git a/crates/sui-graphql-rpc/src/types/event/mod.rs b/crates/sui-graphql-rpc/src/types/event/mod.rs new file mode 100644 index 0000000000000..10c130c7f43c1 --- /dev/null +++ b/crates/sui-graphql-rpc/src/types/event/mod.rs @@ -0,0 +1,285 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +use std::str::FromStr; + +use super::cursor::{Page, Target}; +use super::{ + address::Address, base64::Base64, date_time::DateTime, move_module::MoveModule, + move_value::MoveValue, +}; +use crate::data::{self, DbConnection, QueryExecutor}; +use crate::query; +use crate::{data::Db, error::Error}; +use async_graphql::connection::{Connection, CursorType, Edge}; +use async_graphql::*; +use cursor::EvLookup; +use diesel::{ExpressionMethods, QueryDsl}; +use lookups::{add_bounds, select_emit_module, select_event_type, select_sender}; +use sui_indexer::models::{events::StoredEvent, transactions::StoredTransaction}; +use sui_indexer::schema::{checkpoints, events}; +use sui_types::base_types::ObjectID; +use sui_types::Identifier; +use sui_types::{ + base_types::SuiAddress as NativeSuiAddress, event::Event as NativeEvent, parse_sui_struct_tag, +}; + +mod cursor; +mod filter; +mod lookups; +pub(crate) use cursor::Cursor; +pub(crate) use filter::EventFilter; + +/// A Sui node emits one of the following events: +/// Move event +/// Publish event +/// Transfer object event +/// Delete object event +/// New object event +/// Epoch change event +#[derive(Clone, Debug)] +pub(crate) struct Event { + pub stored: Option, + pub native: NativeEvent, + /// The checkpoint sequence number this was viewed at. + pub checkpoint_viewed_at: u64, +} + +type Query = data::Query; + +#[Object] +impl Event { + /// The Move module containing some function that when called by + /// a programmable transaction block (PTB) emitted this event. + /// For example, if a PTB invokes A::m1::foo, which internally + /// calls A::m2::emit_event to emit an event, + /// the sending module would be A::m1. + async fn sending_module(&self, ctx: &Context<'_>) -> Result> { + MoveModule::query( + ctx, + self.native.package_id.into(), + &self.native.transaction_module.to_string(), + self.checkpoint_viewed_at, + ) + .await + .extend() + } + + /// Address of the sender of the event + async fn sender(&self) -> Result> { + if self.native.sender == NativeSuiAddress::ZERO { + return Ok(None); + } + + Ok(Some(Address { + address: self.native.sender.into(), + checkpoint_viewed_at: self.checkpoint_viewed_at, + })) + } + + /// UTC timestamp in milliseconds since epoch (1/1/1970) + async fn timestamp(&self) -> Result, Error> { + if let Some(stored) = &self.stored { + Ok(Some(DateTime::from_ms(stored.timestamp_ms)?)) + } else { + Ok(None) + } + } + + #[graphql(flatten)] + async fn move_value(&self) -> Result { + Ok(MoveValue::new( + self.native.type_.clone().into(), + Base64::from(self.native.contents.clone()), + )) + } +} + +impl Event { + /// Query the database for a `page` of events. The Page uses the transaction, event, and + /// checkpoint sequence numbers as the cursor to determine the correct page of results. The + /// query can optionally be further `filter`-ed by the `EventFilter`. + /// + /// The `checkpoint_viewed_at` parameter represents the checkpoint sequence number at which + /// this page was queried. Each entity returned in the connection inherits this checkpoint, so + /// that when viewing that entity's state, it's as if it's being viewed at this checkpoint. + /// + /// The cursors in `page` might also include checkpoint viewed at fields. If these are set, + /// they take precedence over the checkpoint that pagination is being conducted in. + pub(crate) async fn paginate( + db: &Db, + page: Page, + filter: EventFilter, + checkpoint_viewed_at: u64, + ) -> Result, Error> { + let cursor_viewed_at = page.validate_cursor_consistency()?; + let checkpoint_viewed_at = cursor_viewed_at.unwrap_or(checkpoint_viewed_at); + + // Construct tx and ev sequence number query with table-relevant filters, if they exist. The + // resulting query will look something like `SELECT tx_sequence_number, + // event_sequence_number FROM lookup_table WHERE ...`. If no filter is provided we don't + // need to use any lookup tables and can just query `events` table, as can be seen in the + // code below. + let query_constraint = match (filter.sender, &filter.emitting_module, &filter.event_type) { + (None, None, None) => None, + (Some(sender), None, None) => Some(select_sender(sender)), + (sender, None, Some(event_type)) => Some(select_event_type(event_type, sender)), + (sender, Some(module), None) => Some(select_emit_module(module, sender)), + (_, Some(_), Some(_)) => { + return Err(Error::Client( + "Filtering by both emitting module and event type is not supported".to_string(), + )) + } + }; + + use checkpoints::dsl; + let (prev, next, results) = db + .execute(move |conn| { + let tx_hi: i64 = conn.first(move || { + dsl::checkpoints.select(dsl::network_total_transactions) + .filter(dsl::sequence_number.eq(checkpoint_viewed_at as i64)) + })?; + + let (prev, next, mut events): (bool, bool, Vec) = + if let Some(filter_query) = query_constraint { + let query = add_bounds(filter_query, &filter.transaction_digest, &page, tx_hi); + + let (prev, next, results) = + page.paginate_raw_query::(conn, checkpoint_viewed_at, query)?; + + let ev_lookups = results + .into_iter() + .map(|x| (x.tx, x.ev)) + .collect::>(); + + if ev_lookups.is_empty() { + return Ok::<_, diesel::result::Error>((prev, next, vec![])); + } + + // Unlike a multi-get on a single column which can be serviced by a query `IN + // (...)`, because events have a composite primary key, the query planner tends + // to perform a sequential scan when given a list of tuples to lookup. A query + // using `UNION ALL` allows us to leverage the index on the composite key. + let events = conn.results(move || { + // Diesel's DSL does not current support chained `UNION ALL`, so we have to turn + // to `RawQuery` here. + let query_string = ev_lookups.iter() + .map(|&(tx, ev)| { + format!("SELECT * FROM events WHERE tx_sequence_number = {} AND event_sequence_number = {}", tx, ev) + }) + .collect::>() + .join(" UNION ALL "); + + query!(query_string).into_boxed() + })?; + (prev, next, events) + } else { + // No filter is provided so we add bounds to the basic `SELECT * FROM + // events` query and call it a day. + let query = add_bounds(query!("SELECT * FROM events"), &filter.transaction_digest, &page, tx_hi); + let (prev, next, events_iter) = page.paginate_raw_query::(conn, checkpoint_viewed_at, query)?; + let events = events_iter.collect::>(); + (prev, next, events) + }; + + // UNION ALL does not guarantee order, so we need to sort the results. Whether + // `first` or `last, the result set is always sorted in ascending order. + events.sort_by(|a, b| { + a.tx_sequence_number.cmp(&b.tx_sequence_number) + .then_with(|| a.event_sequence_number.cmp(&b.event_sequence_number)) + }); + + + Ok::<_, diesel::result::Error>((prev, next, events)) + }) + .await?; + + let mut conn = Connection::new(prev, next); + + // The "checkpoint viewed at" sets a consistent upper bound for the nested queries. + for stored in results { + let cursor = stored.cursor(checkpoint_viewed_at).encode_cursor(); + conn.edges.push(Edge::new( + cursor, + Event::try_from_stored_event(stored, checkpoint_viewed_at)?, + )); + } + + Ok(conn) + } + + pub(crate) fn try_from_stored_transaction( + stored_tx: &StoredTransaction, + idx: usize, + checkpoint_viewed_at: u64, + ) -> Result { + let Some(serialized_event) = &stored_tx.get_event_at_idx(idx) else { + return Err(Error::Internal(format!( + "Could not find event with event_sequence_number {} at transaction {}", + idx, stored_tx.tx_sequence_number + ))); + }; + + let native_event: NativeEvent = bcs::from_bytes(serialized_event).map_err(|_| { + Error::Internal(format!( + "Failed to deserialize event with {} at transaction {}", + idx, stored_tx.tx_sequence_number + )) + })?; + + let stored_event = StoredEvent { + tx_sequence_number: stored_tx.tx_sequence_number, + event_sequence_number: idx as i64, + transaction_digest: stored_tx.transaction_digest.clone(), + #[cfg(feature = "postgres-feature")] + senders: vec![Some(native_event.sender.to_vec())], + package: native_event.package_id.to_vec(), + module: native_event.transaction_module.to_string(), + event_type: native_event + .type_ + .to_canonical_string(/* with_prefix */ true), + bcs: native_event.contents.clone(), + timestamp_ms: stored_tx.timestamp_ms, + }; + + Ok(Self { + stored: Some(stored_event), + native: native_event, + checkpoint_viewed_at, + }) + } + + fn try_from_stored_event( + stored: StoredEvent, + checkpoint_viewed_at: u64, + ) -> Result { + let Some(Some(sender_bytes)) = ({ + #[cfg(feature = "postgres-feature")] + { + stored.senders.first() + } + }) else { + return Err(Error::Internal("No senders found for event".to_string())); + }; + let sender = NativeSuiAddress::from_bytes(sender_bytes) + .map_err(|e| Error::Internal(e.to_string()))?; + let package_id = + ObjectID::from_bytes(&stored.package).map_err(|e| Error::Internal(e.to_string()))?; + let type_ = + parse_sui_struct_tag(&stored.event_type).map_err(|e| Error::Internal(e.to_string()))?; + let transaction_module = + Identifier::from_str(&stored.module).map_err(|e| Error::Internal(e.to_string()))?; + let contents = stored.bcs.clone(); + Ok(Event { + stored: Some(stored), + native: NativeEvent { + sender, + package_id, + transaction_module, + type_, + contents, + }, + checkpoint_viewed_at, + }) + } +} diff --git a/crates/sui-graphql-rpc/src/types/query.rs b/crates/sui-graphql-rpc/src/types/query.rs index f403fbf8657b5..f6f4704b3009f 100644 --- a/crates/sui-graphql-rpc/src/types/query.rs +++ b/crates/sui-graphql-rpc/src/types/query.rs @@ -414,7 +414,9 @@ impl Query { .extend() } - /// The events that exist in the network. + /// Query events that are emitted in the network. + /// We currently do not support filtering by emitting module and event type + /// at the same time so if both are provided in one filter, the query will error. async fn events( &self, ctx: &Context<'_>, diff --git a/crates/sui-graphql-rpc/src/types/type_filter.rs b/crates/sui-graphql-rpc/src/types/type_filter.rs index f2028483989ff..16f9dd03181f1 100644 --- a/crates/sui-graphql-rpc/src/types/type_filter.rs +++ b/crates/sui-graphql-rpc/src/types/type_filter.rs @@ -2,18 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use super::{string_input::impl_string_input, sui_address::SuiAddress}; +use crate::filter; use crate::raw_query::RawQuery; -use crate::{ - data::{DieselBackend, Query}, - filter, -}; use async_graphql::*; -use diesel::{ - expression::{is_aggregate::No, ValidGrouping}, - query_builder::QueryFragment, - sql_types::{Binary, Text}, - AppearsOnTable, Expression, ExpressionMethods, QueryDsl, QuerySource, -}; use move_core_types::language_storage::StructTag; use std::{fmt, result::Result, str::FromStr}; use sui_types::{ @@ -67,89 +58,7 @@ pub(crate) enum Error { InvalidFormat(&'static str), } -/// Trait for a field that can be used in a query. -pub(crate) trait Field: - ExpressionMethods - + Expression - + QueryFragment - + AppearsOnTable - + ValidGrouping<(), IsAggregate = No> - + Send - + 'static -{ -} - -impl Field for T where - T: ExpressionMethods - + Expression - + QueryFragment - + AppearsOnTable - + ValidGrouping<(), IsAggregate = No> - + Send - + 'static -{ -} - impl TypeFilter { - /// Modify `query` to apply this filter to `type_field`, `package_field`, `module_field` - /// and `name_field`, where `type_field` stores the full type tag while the rest - /// store the package, module and name of the type tag respectively. The new query - /// after applying the filter is returned. - pub(crate) fn apply( - &self, - query: Query, - // Field storing the full type tag, including type parameters. - type_field: T, - package_field: P, - module_field: M, - // Name field only includes the name of the struct, like `Coin`, not including type parameters. - name_field: N, - ) -> Query - where - Query: QueryDsl, - T: Field, - P: Field, - M: Field, - N: Field, - QS: QuerySource, - { - match self { - TypeFilter::ByModule(ModuleFilter::ByPackage(p)) => { - query.filter(package_field.eq(p.into_vec())) - } - - TypeFilter::ByModule(ModuleFilter::ByModule(p, m)) => query - .filter(package_field.eq(p.into_vec())) - .filter(module_field.eq(m.clone())), - - // A type filter without type parameters is interpreted as either an exact match, or a - // match for all generic instantiations of the type so we check against only package, module - // and name fields. - TypeFilter::ByType(tag) if tag.type_params.is_empty() => { - let p = tag.address.to_vec(); - let m = tag.module.to_string(); - let n = tag.name.to_string(); - query - .filter(package_field.eq(p)) - .filter(module_field.eq(m)) - .filter(name_field.eq(n)) - } - - TypeFilter::ByType(tag) => { - let p = tag.address.to_vec(); - let m = tag.module.to_string(); - let n = tag.name.to_string(); - let exact = tag.to_canonical_string(/* with_prefix */ true); - // We check against the full type field for an exact match, including type parameters. - query - .filter(package_field.eq(p)) - .filter(module_field.eq(m)) - .filter(name_field.eq(n)) - .filter(type_field.eq(exact)) - } - } - } - /// Modify `query` to apply this filter to `field`, returning the new query. pub(crate) fn apply_raw( &self, @@ -295,28 +204,6 @@ impl FqNameFilter { } impl ModuleFilter { - /// Modify `query` to apply this filter, treating `package` as the column containing the package - /// address and `module` as the module containing the module name. - pub(crate) fn apply( - &self, - query: Query, - package: P, - module: M, - ) -> Query - where - Query: QueryDsl, - P: Field, - M: Field, - QS: QuerySource, - { - match self { - ModuleFilter::ByPackage(p) => query.filter(package.eq(p.into_vec())), - ModuleFilter::ByModule(p, m) => query - .filter(package.eq(p.into_vec())) - .filter(module.eq(m.clone())), - } - } - /// Try to create a filter whose results are the intersection of the results of the input /// filters (`self` and `other`). This may not be possible if the resulting filter is /// inconsistent (e.g. a filter that requires the module's package to be at two different diff --git a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap index fd04f186f34b6..ed3ec693362f4 100644 --- a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap +++ b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap @@ -1276,6 +1276,8 @@ input EventFilter { PTB and emits an event. Modules can be filtered by their package, or package::module. + We currently do not support filtering by emitting module and event type + at the same time so if both are provided in one filter, the query will error. """ emittingModule: String """ @@ -3316,7 +3318,9 @@ type Query { """ transactionBlocks(first: Int, after: String, last: Int, before: String, filter: TransactionBlockFilter, scanLimit: Int): TransactionBlockConnection! """ - The events that exist in the network. + Query events that are emitted in the network. + We currently do not support filtering by emitting module and event type + at the same time so if both are provided in one filter, the query will error. """ events(first: Int, after: String, last: Int, before: String, filter: EventFilter): EventConnection! """ diff --git a/crates/sui-indexer/migrations/pg/2023-08-19-044020_events/up.sql b/crates/sui-indexer/migrations/pg/2023-08-19-044020_events/up.sql index dfbfa3ea14495..14aa6a098161f 100644 --- a/crates/sui-indexer/migrations/pg/2023-08-19-044020_events/up.sql +++ b/crates/sui-indexer/migrations/pg/2023-08-19-044020_events/up.sql @@ -4,7 +4,6 @@ CREATE TABLE events tx_sequence_number BIGINT NOT NULL, event_sequence_number BIGINT NOT NULL, transaction_digest bytea NOT NULL, - checkpoint_sequence_number bigint NOT NULL, -- array of SuiAddress in bytes. All signers of the transaction. senders bytea[] NOT NULL, -- bytes of the entry package ID. Notice that the package and module here @@ -15,11 +14,6 @@ CREATE TABLE events module text NOT NULL, -- StructTag in Display format, fully qualified including type parameters event_type text NOT NULL, - -- Components of the StructTag of the event type: package, module, - -- name (name of the struct, without type parameters) - event_type_package bytea NOT NULL, - event_type_module text NOT NULL, - event_type_name text NOT NULL, -- timestamp of the checkpoint when the event was emitted timestamp_ms BIGINT NOT NULL, -- bcs of the Event contents (Event.contents) @@ -30,5 +24,3 @@ CREATE TABLE events_partition_0 PARTITION OF events FOR VALUES FROM (0) TO (MAXV CREATE INDEX events_package ON events (package, tx_sequence_number, event_sequence_number); CREATE INDEX events_package_module ON events (package, module, tx_sequence_number, event_sequence_number); CREATE INDEX events_event_type ON events (event_type text_pattern_ops, tx_sequence_number, event_sequence_number); -CREATE INDEX events_type_package_module_name ON events (event_type_package, event_type_module, event_type_name, tx_sequence_number, event_sequence_number); -CREATE INDEX events_checkpoint_sequence_number ON events (checkpoint_sequence_number); diff --git a/crates/sui-indexer/src/models/events.rs b/crates/sui-indexer/src/models/events.rs index 455b22e1741fe..01f79c41d6ab2 100644 --- a/crates/sui-indexer/src/models/events.rs +++ b/crates/sui-indexer/src/models/events.rs @@ -31,9 +31,6 @@ pub struct StoredEvent { #[diesel(sql_type = diesel::sql_types::Binary)] pub transaction_digest: Vec, - #[diesel(sql_type = diesel::sql_types::BigInt)] - pub checkpoint_sequence_number: i64, - #[cfg(feature = "postgres-feature")] #[diesel(sql_type = diesel::sql_types::Array>)] pub senders: Vec>>, @@ -52,15 +49,6 @@ pub struct StoredEvent { #[diesel(sql_type = diesel::sql_types::Text)] pub event_type: String, - #[diesel(sql_type = diesel::sql_types::Binary)] - pub event_type_package: Vec, - - #[diesel(sql_type = diesel::sql_types::Text)] - pub event_type_module: String, - - #[diesel(sql_type = diesel::sql_types::Text)] - pub event_type_name: String, - #[diesel(sql_type = diesel::sql_types::BigInt)] pub timestamp_ms: i64, @@ -81,7 +69,6 @@ impl From for StoredEvent { tx_sequence_number: event.tx_sequence_number as i64, event_sequence_number: event.event_sequence_number as i64, transaction_digest: event.transaction_digest.into_inner().to_vec(), - checkpoint_sequence_number: event.checkpoint_sequence_number as i64, #[cfg(feature = "postgres-feature")] senders: event .senders @@ -94,9 +81,6 @@ impl From for StoredEvent { package: event.package.to_vec(), module: event.module.clone(), event_type: event.event_type.clone(), - event_type_package: event.event_type_package.to_vec(), - event_type_module: event.event_type_module.clone(), - event_type_name: event.event_type_name.clone(), bcs: event.bcs.clone(), timestamp_ms: event.timestamp_ms as i64, } diff --git a/crates/sui-indexer/src/schema/mysql.rs b/crates/sui-indexer/src/schema/mysql.rs index 8db69b30f75cf..4b4799566a0d4 100644 --- a/crates/sui-indexer/src/schema/mysql.rs +++ b/crates/sui-indexer/src/schema/mysql.rs @@ -260,14 +260,6 @@ diesel::table! { } } -diesel::table! { - pruner_cp_watermark (checkpoint_sequence_number) { - checkpoint_sequence_number -> Bigint, - min_tx_sequence_number -> Bigint, - max_tx_sequence_number -> Bigint, - } -} - diesel::table! { transactions (tx_sequence_number, checkpoint_sequence_number) { tx_sequence_number -> Bigint, @@ -383,7 +375,6 @@ macro_rules! for_all_tables { objects_snapshot, objects_version, packages, - pruner_cp_watermark, transactions, tx_calls_fun, tx_calls_mod, diff --git a/crates/sui-indexer/src/schema/pg.rs b/crates/sui-indexer/src/schema/pg.rs index 2515c98d34c06..c1720c94b37a1 100644 --- a/crates/sui-indexer/src/schema/pg.rs +++ b/crates/sui-indexer/src/schema/pg.rs @@ -137,14 +137,10 @@ diesel::table! { tx_sequence_number -> Int8, event_sequence_number -> Int8, transaction_digest -> Bytea, - checkpoint_sequence_number -> Int8, senders -> Array>, package -> Bytea, module -> Text, event_type -> Text, - event_type_package -> Bytea, - event_type_module -> Text, - event_type_name -> Text, timestamp_ms -> Int8, bcs -> Bytea, } @@ -155,14 +151,10 @@ diesel::table! { tx_sequence_number -> Int8, event_sequence_number -> Int8, transaction_digest -> Bytea, - checkpoint_sequence_number -> Int8, senders -> Array>, package -> Bytea, module -> Text, event_type -> Text, - event_type_package -> Bytea, - event_type_module -> Text, - event_type_name -> Text, timestamp_ms -> Int8, bcs -> Bytea, } diff --git a/crates/sui-indexer/tests/ingestion_tests.rs b/crates/sui-indexer/tests/ingestion_tests.rs index af67a061bbde3..8eee88f8bd448 100644 --- a/crates/sui-indexer/tests/ingestion_tests.rs +++ b/crates/sui-indexer/tests/ingestion_tests.rs @@ -5,7 +5,6 @@ mod ingestion_tests { use diesel::ExpressionMethods; use diesel::{QueryDsl, RunQueryDsl}; - use move_core_types::language_storage::StructTag; use simulacrum::Simulacrum; use std::net::SocketAddr; use std::path::PathBuf; @@ -14,18 +13,14 @@ mod ingestion_tests { use sui_indexer::db::get_pool_connection; use sui_indexer::errors::Context; use sui_indexer::errors::IndexerError; - use sui_indexer::models::{ - events::StoredEvent, objects::StoredObject, transactions::StoredTransaction, - }; - use sui_indexer::schema::{events, objects, transactions}; + use sui_indexer::models::{objects::StoredObject, transactions::StoredTransaction}; + use sui_indexer::schema::{objects, transactions}; use sui_indexer::store::{indexer_store::IndexerStore, PgIndexerStore}; use sui_indexer::test_utils::{start_test_indexer, ReaderWriterConfig}; use sui_types::base_types::SuiAddress; use sui_types::effects::TransactionEffectsAPI; use sui_types::gas_coin::GasCoin; - use sui_types::{ - Identifier, SUI_FRAMEWORK_PACKAGE_ID, SUI_SYSTEM_ADDRESS, SUI_SYSTEM_PACKAGE_ID, - }; + use sui_types::SUI_FRAMEWORK_PACKAGE_ID; use tempfile::tempdir; use tokio::task::JoinHandle; @@ -93,24 +88,6 @@ mod ingestion_tests { Ok(()) } - /// Wait for the indexer to catch up to the given epoch id. - async fn wait_for_epoch( - pg_store: &PgIndexerStore, - epoch: u64, - ) -> Result<(), IndexerError> { - tokio::time::timeout(Duration::from_secs(10), async { - while { - let cp_opt = pg_store.get_latest_epoch_id().unwrap(); - cp_opt.is_none() || (cp_opt.unwrap() < epoch) - } { - tokio::time::sleep(Duration::from_secs(1)).await; - } - }) - .await - .expect("Timeout waiting for indexer to catchup to epoch"); - Ok(()) - } - #[tokio::test] pub async fn test_transaction_table() -> Result<(), IndexerError> { let mut sim = Simulacrum::new(); @@ -156,46 +133,6 @@ mod ingestion_tests { Ok(()) } - #[tokio::test] - pub async fn test_event_type() -> Result<(), IndexerError> { - let mut sim = Simulacrum::new(); - let data_ingestion_path = tempdir().unwrap().into_path(); - sim.set_data_ingestion_path(data_ingestion_path.clone()); - - // Advance the epoch to generate some events. - sim.advance_epoch(false); - - let (_, pg_store, _) = set_up(Arc::new(sim), data_ingestion_path).await; - - // Wait for the epoch to change so we can get some events. - wait_for_epoch(&pg_store, 1).await?; - - // Read the event from the database directly. - let db_event: StoredEvent = read_only_blocking!(&pg_store.blocking_cp(), |conn| { - events::table - .filter(events::event_type_name.eq("SystemEpochInfoEvent")) - .first::(conn) - }) - .context("Failed reading SystemEpochInfoEvent from PostgresDB")?; - - let event_type_tag = StructTag { - address: SUI_SYSTEM_ADDRESS, - module: Identifier::new("sui_system_state_inner").unwrap(), - name: Identifier::new("SystemEpochInfoEvent").unwrap(), - type_params: vec![], - }; - - // Check that the different components of the event type were stored correctly. - assert_eq!( - db_event.event_type, - event_type_tag.to_canonical_string(true) - ); - assert_eq!(db_event.event_type_package, SUI_SYSTEM_PACKAGE_ID.to_vec()); - assert_eq!(db_event.event_type_module, "sui_system_state_inner"); - assert_eq!(db_event.event_type_name, "SystemEpochInfoEvent"); - Ok(()) - } - #[tokio::test] pub async fn test_object_type() -> Result<(), IndexerError> { let mut sim = Simulacrum::new(); diff --git a/crates/sui-node/src/admin.rs b/crates/sui-node/src/admin.rs index 3d5e44241268d..3c867e2f994a0 100644 --- a/crates/sui-node/src/admin.rs +++ b/crates/sui-node/src/admin.rs @@ -250,11 +250,6 @@ async fn capabilities(State(state): State>) -> (StatusCode, String output.push_str(&format!("{:?}\n", capability)); } - let capabilities = epoch_store.get_capabilities_v2(); - for capability in &capabilities { - output.push_str(&format!("{:?}\n", capability)); - } - (StatusCode::OK, output) } diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index f01df691e4369..85a4c2c11a5ba 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -12,7 +12,7 @@ "name": "Apache-2.0", "url": "https://raw.githubusercontent.com/MystenLabs/sui/main/LICENSE" }, - "version": "1.32.0" + "version": "1.32.1" }, "methods": [ { diff --git a/crates/typed-store/src/metrics.rs b/crates/typed-store/src/metrics.rs index 904ad5a31cf67..f7049d8d63768 100644 --- a/crates/typed-store/src/metrics.rs +++ b/crates/typed-store/src/metrics.rs @@ -77,6 +77,7 @@ impl SamplingInterval { pub struct ColumnFamilyMetrics { pub rocksdb_total_sst_files_size: IntGaugeVec, pub rocksdb_total_blob_files_size: IntGaugeVec, + pub rocksdb_current_size_active_mem_tables: IntGaugeVec, pub rocksdb_size_all_mem_tables: IntGaugeVec, pub rocksdb_num_snapshots: IntGaugeVec, pub rocksdb_oldest_snapshot_time: IntGaugeVec, @@ -86,13 +87,16 @@ pub struct ColumnFamilyMetrics { pub rocksdb_block_cache_usage: IntGaugeVec, pub rocksdb_block_cache_pinned_usage: IntGaugeVec, pub rocksdb_estimate_table_readers_mem: IntGaugeVec, + pub rocksdb_num_immutable_mem_tables: IntGaugeVec, pub rocksdb_mem_table_flush_pending: IntGaugeVec, pub rocksdb_compaction_pending: IntGaugeVec, + pub rocksdb_estimate_pending_compaction_bytes: IntGaugeVec, pub rocksdb_num_running_compactions: IntGaugeVec, pub rocksdb_num_running_flushes: IntGaugeVec, pub rocksdb_estimate_oldest_key_time: IntGaugeVec, pub rocksdb_background_errors: IntGaugeVec, pub rocksdb_estimated_num_keys: IntGaugeVec, + pub rocksdb_base_level: IntGaugeVec, } impl ColumnFamilyMetrics { @@ -112,6 +116,13 @@ impl ColumnFamilyMetrics { registry, ) .unwrap(), + rocksdb_current_size_active_mem_tables: register_int_gauge_vec_with_registry!( + "rocksdb_current_size_active_mem_tables", + "The current approximate size of active memtable (bytes).", + &["cf_name"], + registry, + ) + .unwrap(), rocksdb_size_all_mem_tables: register_int_gauge_vec_with_registry!( "rocksdb_size_all_mem_tables", "The memory size occupied by the column family's in-memory buffer", @@ -177,6 +188,13 @@ impl ColumnFamilyMetrics { registry, ) .unwrap(), + rocksdb_num_immutable_mem_tables: register_int_gauge_vec_with_registry!( + "rocksdb_num_immutable_mem_tables", + "The number of immutable memtables that have not yet been flushed.", + &["cf_name"], + registry, + ) + .unwrap(), rocksdb_mem_table_flush_pending: register_int_gauge_vec_with_registry!( "rocksdb_mem_table_flush_pending", "A 1 or 0 flag indicating whether a memtable flush is pending. @@ -198,6 +216,14 @@ impl ColumnFamilyMetrics { registry, ) .unwrap(), + rocksdb_estimate_pending_compaction_bytes: register_int_gauge_vec_with_registry!( + "rocksdb_estimate_pending_compaction_bytes", + "Estimated total number of bytes compaction needs to rewrite to get all levels down + to under target size. Not valid for other compactions than level-based.", + &["cf_name"], + registry, + ) + .unwrap(), rocksdb_num_running_compactions: register_int_gauge_vec_with_registry!( "rocksdb_num_running_compactions", "The number of compactions that are currently running for the column family.", @@ -234,7 +260,13 @@ impl ColumnFamilyMetrics { registry, ) .unwrap(), - + rocksdb_base_level: register_int_gauge_vec_with_registry!( + "rocksdb_base_level", + "The number of level to which L0 data will be compacted.", + &["cf_name"], + registry, + ) + .unwrap(), } } } diff --git a/crates/typed-store/src/rocks/mod.rs b/crates/typed-store/src/rocks/mod.rs index ca6505b9a448e..6bf550f4aa131 100644 --- a/crates/typed-store/src/rocks/mod.rs +++ b/crates/typed-store/src/rocks/mod.rs @@ -704,7 +704,7 @@ impl MetricConf { } } } -const CF_METRICS_REPORT_PERIOD_MILLIS: u64 = 1000; +const CF_METRICS_REPORT_PERIOD_SECS: u64 = 30; const METRICS_ERROR: i64 = -1; /// An interface to a rocksDB database, keyed by a columnfamily @@ -740,7 +740,7 @@ impl DBMap { if !is_deprecated { tokio::task::spawn(async move { let mut interval = - tokio::time::interval(Duration::from_millis(CF_METRICS_REPORT_PERIOD_MILLIS)); + tokio::time::interval(Duration::from_secs(CF_METRICS_REPORT_PERIOD_SECS)); loop { tokio::select! { _ = interval.tick() => { @@ -983,6 +983,14 @@ impl DBMap { Self::get_int_property(rocksdb, &cf, ROCKSDB_PROPERTY_TOTAL_BLOB_FILES_SIZE) .unwrap_or(METRICS_ERROR), ); + db_metrics + .cf_metrics + .rocksdb_current_size_active_mem_tables + .with_label_values(&[cf_name]) + .set( + Self::get_int_property(rocksdb, &cf, properties::CUR_SIZE_ACTIVE_MEM_TABLE) + .unwrap_or(METRICS_ERROR), + ); db_metrics .cf_metrics .rocksdb_size_all_mem_tables @@ -1063,6 +1071,14 @@ impl DBMap { Self::get_int_property(rocksdb, &cf, properties::ESTIMATE_NUM_KEYS) .unwrap_or(METRICS_ERROR), ); + db_metrics + .cf_metrics + .rocksdb_num_immutable_mem_tables + .with_label_values(&[cf_name]) + .set( + Self::get_int_property(rocksdb, &cf, properties::NUM_IMMUTABLE_MEM_TABLE) + .unwrap_or(METRICS_ERROR), + ); db_metrics .cf_metrics .rocksdb_mem_table_flush_pending @@ -1079,6 +1095,14 @@ impl DBMap { Self::get_int_property(rocksdb, &cf, properties::COMPACTION_PENDING) .unwrap_or(METRICS_ERROR), ); + db_metrics + .cf_metrics + .rocksdb_estimate_pending_compaction_bytes + .with_label_values(&[cf_name]) + .set( + Self::get_int_property(rocksdb, &cf, properties::ESTIMATE_PENDING_COMPACTION_BYTES) + .unwrap_or(METRICS_ERROR), + ); db_metrics .cf_metrics .rocksdb_num_running_compactions @@ -1111,6 +1135,14 @@ impl DBMap { Self::get_int_property(rocksdb, &cf, properties::BACKGROUND_ERRORS) .unwrap_or(METRICS_ERROR), ); + db_metrics + .cf_metrics + .rocksdb_base_level + .with_label_values(&[cf_name]) + .set( + Self::get_int_property(rocksdb, &cf, properties::BASE_LEVEL) + .unwrap_or(METRICS_ERROR), + ); } pub fn transaction(&self) -> Result, TypedStoreError> {