diff --git a/.github/actions/setup-rust/action.yaml b/.github/actions/setup-rust/action.yaml deleted file mode 100644 index 976bce3..0000000 --- a/.github/actions/setup-rust/action.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Setup Rust -description: Installs rust in a bare metal fashion -inputs: - caller-workflow-name: - description: 'Name of workflow used for creating a cache key in ASCII format.' - required: true - default: '' - -runs: - using: composite - steps: - - name: Generate cache key - id: cache-key-generator - run: echo "cache-key=$(echo ${{inputs.caller-workflow-name}} | tr ' ' '_')" >> $GITHUB_OUTPUT - shell: bash - - - name: Check cache key - run: "echo Cache key: ${{ steps.cache-key-generator.outputs.cache-key }}" - shell: bash - - - name: Install Protobuf - run: | - export PROTOC_VERSION=21.12 && \ - export PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip && \ - curl -Ss -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \ - && sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \ - && sudo unzip -o $PROTOC_ZIP -d /usr/local include/* \ - && rm -f $PROTOC_ZIP - shell: bash - - - name: cache dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cargo - key: ${{ runner.os }}-cargo-${{ steps.cache-key-generator.outputs.cache-key }}-${{ hashFiles('**/Cargo.lock') }} - - - name: cache rust files - uses: actions/cache@v3 - with: - path: | - target/ - key: ${{ runner.os }}-cargo-${{ steps.cache-key-generator.outputs.cache-key }}-${{ hashFiles('**/*.rs') }} - - - name: Check rust version before - run: | - rustc --version || true; - cargo --version || true; - cargo clippy --version || true; - cargo fmt --version || true; - shell: bash diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 066cc9d..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build -on: - workflow_call: - inputs: - TAG: - required: true - type: string - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - uses: jpribyl/action-docker-layer-caching@v0.1.1 - # Ignore the failure of a step and avoid terminating the job. - continue-on-error: true - - - name: Build containers - run: docker build -t jitolabs/geyser-grpc-plugin:${{ inputs.TAG }} . --progress=plain - env: - COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_BUILDKIT: 1 - ORG: jitolabs - TAG: ${{ inputs.TAG }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5f76d36 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,63 @@ +name: Geyser CI + +on: + push: + branches: + - master + - 'v*.*' + tags: + - 'v*.*.*' + pull_request: + branches: + - master + - 'v*.*' + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt, clippy + - name: Install cargo-sort from crates.io + uses: baptiste0928/cargo-install@v3 + with: + crate: cargo-sort + version: "1.0.9" + - name: Cargo sort + run: cargo sort --workspace --check + - name: run clippy + run: cargo clippy --all-features -- -D clippy::all + + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo build --release + + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo test --all-features --all-targets + + release: + name: release + runs-on: ubuntu-latest + needs: [build, test, lint] + if: ${{ startsWith(github.ref, 'refs/tags/') }} + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo build --release + - name: Create release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./target/release/libgeyser_grpc_plugin_server.so diff --git a/.github/workflows/clean_code.yaml b/.github/workflows/clean_code.yaml deleted file mode 100644 index ce32f03..0000000 --- a/.github/workflows/clean_code.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: Clean Code Check -on: - workflow_call: - -jobs: - clippy_check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Setup Rust - uses: ./.github/actions/setup-rust - with: - caller-workflow-name: clippy_check - - - name: Setup Rust tools - run: cargo install cargo-sort --locked - - - name: Cargo sort - run: cargo sort --workspace --check - - - name: Clippy Check - run: cargo clippy --all-features --all-targets --tests diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml deleted file mode 100644 index e85dc43..0000000 --- a/.github/workflows/master.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: Master -on: - push: - branches: - - master - -jobs: - clean_code_check: - uses: ./.github/workflows/clean_code.yaml - - build_images: - needs: clean_code_check - uses: ./.github/workflows/build.yaml - with: - TAG: "latest" - - run_tests: - needs: build_images - uses: ./.github/workflows/test.yaml - - push_artifacts: - needs: run_tests - uses: ./.github/workflows/push_artifacts.yaml - with: - TAG: "latest" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml deleted file mode 100644 index 881736c..0000000 --- a/.github/workflows/pr.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Pull Request -on: - pull_request: - -jobs: - clean_code_check: - uses: ./.github/workflows/clean_code.yaml - - run_tests: - needs: clean_code_check - uses: ./.github/workflows/test.yaml diff --git a/.github/workflows/push_artifacts.yaml b/.github/workflows/push_artifacts.yaml deleted file mode 100644 index 33bce7a..0000000 --- a/.github/workflows/push_artifacts.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Push Artifacts -on: - workflow_call: - inputs: - TAG: - required: true - type: string - -jobs: - push: - name: Push Artifacts - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Build containers - run: docker build -t jitolabs/geyser-grpc-plugin:${{ inputs.TAG }} . --progress=plain - env: - COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_BUILDKIT: 1 - ORG: jitolabs - TAG: ${{ inputs.TAG }} - - - name: Copy artifact from container - run: | - docker run --rm --entrypoint cat jitolabs/geyser-grpc-plugin:${{ inputs.TAG }} /geyser-grpc-plugin/container-output/libgeyser_grpc_plugin_server.so > libgeyser_grpc_plugin_server.so - ls -lh . - file libgeyser_grpc_plugin_server.so - - - name: Create Release with artifact - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: ./libgeyser_grpc_plugin_server.so diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 4ef8818..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release -on: - push: - tags: - - 'v*.*.*' -env: - TAG: "$(git rev-parse --short HEAD)" - -jobs: - clean_code_check: - uses: ./.github/workflows/clean_code.yaml - - run_tests: - needs: clean_code_check - uses: ./.github/workflows/test.yaml - - push_artifacts: - needs: run_tests - uses: ./.github/workflows/push_artifacts.yaml - with: - TAG: ${{ github.ref_name }}-${{ github.sha }} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 692f32b..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Test -on: - workflow_call: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Setup Rust - uses: ./.github/actions/setup-rust - with: - caller-workflow-name: test - - - name: Run tests - run: cargo test --all-features --all-targets --locked diff --git a/Cargo.lock b/Cargo.lock index 5792f53..ed816d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -360,7 +360,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -371,7 +371,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -468,9 +468,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bincode" @@ -489,9 +489,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -703,14 +703,14 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -789,7 +789,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -879,11 +879,10 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] @@ -913,12 +912,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -990,7 +986,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1001,7 +997,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1099,22 +1095,22 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" +checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1130,6 +1126,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -1226,7 +1228,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1306,7 +1308,7 @@ dependencies = [ [[package]] name = "geyser-grpc-plugin-client" -version = "1.17.1" +version = "1.17.19" dependencies = [ "jito-geyser-protos", "log", @@ -1325,7 +1327,7 @@ dependencies = [ [[package]] name = "geyser-grpc-plugin-server" -version = "1.17.1" +version = "1.17.19" dependencies = [ "bs58 0.5.0", "crossbeam-channel", @@ -1382,7 +1384,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1647,6 +1649,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + [[package]] name = "instant" version = "0.1.12" @@ -1690,7 +1702,7 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jito-geyser-cli" -version = "1.17.1" +version = "1.17.19" dependencies = [ "clap", "futures-util", @@ -1705,7 +1717,7 @@ dependencies = [ [[package]] name = "jito-geyser-protos" -version = "1.17.1" +version = "1.17.19" dependencies = [ "bincode", "bs58 0.5.0", @@ -1732,9 +1744,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1756,9 +1768,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libsecp256k1" @@ -2008,7 +2020,7 @@ checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2090,7 +2102,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2099,10 +2111,10 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2116,9 +2128,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -2195,7 +2207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -2215,7 +2227,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2267,7 +2279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2286,14 +2298,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.0", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2325,7 +2346,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.38", + "syn 2.0.48", "tempfile", "which", ] @@ -2340,7 +2361,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2378,14 +2399,14 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2529,12 +2550,12 @@ checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "async-compression", - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -2556,6 +2577,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", @@ -2637,7 +2659,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", ] [[package]] @@ -2685,7 +2707,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2706,38 +2728,38 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2775,7 +2797,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2877,12 +2899,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a6ad350a6f633fd76e8bd1e77ad7a3ce75e3046d69957cdb042152e84d8957" +checksum = "059f3ef625b303fe2ed6aad853e8e9fc8aa54d26921083285bc9f9a7d7a84db1" dependencies = [ "Inflector", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bs58 0.4.0", "bv", @@ -2902,9 +2924,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce2f25dbe765208a79af782b79b2d06f382a82b13050890edd52dcab11078b8" +checksum = "16e8dfaa1c61292a9e1bdf15ebb8d1315adb19e923a21c12a0a4d15db6d94e1e" dependencies = [ "bincode", "chrono", @@ -2916,9 +2938,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62311c3a992af13c270d9bf219b6d7534f7ddc30074fa31a5261273e9f7d4b83" +checksum = "380a5173027b9d70fa033272ebc8ffe8e59c64274109ac99b05578a4c9434215" dependencies = [ "ahash 0.8.5", "blake3", @@ -2946,21 +2968,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9b64778efc635c7cd8cae084fef4b034b7f2b5a0c022d5173179446c56e71f" +checksum = "d1017a631a72e211f8bd78e707c9424fb0ef074f3df5bb7b6baef6912a3b1b6b" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "solana-geyser-plugin-interface" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7aead0927e748bd3f15882dd21cf54b0f7078fa7aeecc6b2589059897e271e" +checksum = "48a4156d2be5ac66c2c2fd13a880b7f3593e6f14b03b8ba0cf6fab5b7f150849" dependencies = [ "log", "solana-sdk", @@ -2970,9 +2992,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6960f7149fb0ec738d04224f5f44b331c467e8fec4ede41c6c702562f0365688" +checksum = "dfcfc4dc59c2f64b0d78b27e5db0238e4f6be852454b0f915bd1f58806fe08c3" dependencies = [ "env_logger", "lazy_static", @@ -2981,9 +3003,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d14133e480bd877b8b4174fc7fc8c591b227d451d0fd48c917e5d3af7bac978" +checksum = "5766f4f11b7c34ba0d1be3b94f303b57a826f5f773c29b90a96d0fb80286df29" dependencies = [ "log", "solana-sdk", @@ -2991,9 +3013,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf4c91c0dd58c83fa0065b777ebaf16a6977b145ae847937b4e8aa119993d96" +checksum = "1bdbfd703709a927eb3bc35b478eefa91b354778a6692141abd1a13648acfceb" dependencies = [ "crossbeam-channel", "gethostname", @@ -3006,17 +3028,17 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75eabbb12920ffe88155f611450a17d6ae28b754b707ec63f83ada500014c8a" +checksum = "e882d2ae4903aec8657d18075897cba532155d8f49a0aa39acc0f86fee8c5697" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", - "base64 0.21.4", + "base64 0.21.7", "bincode", - "bitflags 2.4.0", + "bitflags 2.4.2", "blake3", "borsh 0.10.3", "borsh 0.9.3", @@ -3060,11 +3082,11 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917a320dca9f88fb3ca4f5549205b0525e47f51b6b98eb34f6728038df484b44" +checksum = "d29040e56093c2d4951e621afc5addc24dead5028d4972ca741feb9e3b12ecef" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bincode", "eager", "enum-iterator", @@ -3088,14 +3110,14 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1628655c50328b0a676b1a956bfbdd39e4ee8e1d48f59aaa907da16393c742b" +checksum = "4b191352781d621b08b3513b02857c8e89f891a8e2aeeeecff977f9819e1a7d5" dependencies = [ "assert_matches", - "base64 0.21.4", + "base64 0.21.7", "bincode", - "bitflags 2.4.0", + "bitflags 2.4.2", "borsh 0.10.3", "bs58 0.4.0", "bytemuck", @@ -3142,15 +3164,15 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17489fa2101a7bfbd19629e53f6801f4428c584a5964acfc861d0151eb9b502" +checksum = "c4a7d5483adb2e54e79160ff03fb20fc93e537cc06bef0fc964e2e6e3bbefdbd" dependencies = [ "bs58 0.4.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3161,12 +3183,12 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-transaction-status" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d374b4db545fe897d8f111d4b0150cd6417a94c7612724a2367fd268ff0d3bb2" +checksum = "b0069b2d163939c4084f91b50b2e1de7848ce7e0e8ecde92f894771fb97fc786" dependencies = [ "Inflector", - "base64 0.21.4", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bs58 0.4.0", @@ -3186,9 +3208,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca84f0eab3aa693d5af43d062c2c54022fc7ca0ea8792bd74d03e5120b4ea0f6" +checksum = "c3a83b8c25a3332669e4ef795c33e724b82acbfcd1f646a482b0966e63392300" dependencies = [ "bincode", "log", @@ -3208,12 +3230,12 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.17.17" +version = "1.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0800a272fd47a03ec1a322078e7bef1d988c3d3d576c9d79547af55cbe1f8eab" +checksum = "28bfe4443f550d37b0055d3dade5ae0dc951d8f80b9f58f1043b699fe9a2f326" dependencies = [ "aes-gcm-siv", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bytemuck", "byteorder", @@ -3295,7 +3317,7 @@ checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" dependencies = [ "quote", "spl-discriminator-syn", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3307,7 +3329,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.38", + "syn 2.0.48", "thiserror", ] @@ -3355,7 +3377,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3492,9 +3514,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3552,22 +3574,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3639,7 +3661,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3688,9 +3710,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.0" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886f31a9b85b6182cabd4d8b07df3b451afcc216563748201490940d2a28ed36" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" @@ -3698,11 +3720,22 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233d8716cdc5d20ec88a18a839edaf545edc71efa4a5ff700ef4a102c26cd8fa" dependencies = [ - "indexmap", + "indexmap 1.9.3", "nom8", "toml_datetime", ] +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.2", + "toml_datetime", + "winnow", +] + [[package]] name = "tonic" version = "0.10.2" @@ -3712,7 +3745,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.4", + "base64 0.21.7", "bytes", "h2", "http", @@ -3743,7 +3776,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3754,7 +3787,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand 0.8.5", @@ -3798,7 +3831,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3941,9 +3974,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3951,16 +3984,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -3978,9 +4011,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3988,22 +4021,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" @@ -4204,6 +4237,15 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "winnow" +version = "0.5.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -4231,7 +4273,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4251,7 +4293,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 56cec5c..742822a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ resolver = "2" [workspace.package] -version = "1.17.1" +version = "1.17.19" license = "Apache-2.0" authors = ["Jito Foundation "] edition = "2021" @@ -24,8 +24,8 @@ clap = { version = "4.4.6", features = ["derive", "env"] } crossbeam-channel = "0.5.8" enum-iterator = "1.4.1" futures-util = "0.3.28" -geyser-grpc-plugin-client = { path = "client" } -jito-geyser-protos = { path = "proto" } +geyser-grpc-plugin-client = { path = "client", version = "=1.17.19" } +jito-geyser-protos = { path = "proto", version = "=1.17.19" } log = "0.4.17" lru = "0.12.0" once_cell = "1.17.1" @@ -36,14 +36,14 @@ rand = "0.8" serde = "1.0.160" serde_derive = "1.0.160" serde_json = "1.0.96" -solana-account-decoder = "1.17.16" -solana-geyser-plugin-interface = "1.17.16" -solana-logger = "1.17.16" -solana-metrics = "1.17.16" -solana-program = "1.17.16" -solana-sdk = "1.17.16" -solana-transaction-status = "1.17.16" -solana-vote-program = "1.17.16" +solana-account-decoder = "=1.17.20" +solana-geyser-plugin-interface = "=1.17.20" +solana-logger = "=1.17.20" +solana-metrics = "=1.17.20" +solana-program = "=1.17.20" +solana-sdk = "=1.17.20" +solana-transaction-status = "=1.17.20" +solana-vote-program = "=1.17.20" thiserror = "1.0.40" tokio = { version = "1", features = ["rt-multi-thread"] } tokio-stream = "0.1" diff --git a/README.md b/README.md index 41cf699..f084073 100644 --- a/README.md +++ b/README.md @@ -2,61 +2,43 @@ A lightweight gRPC service for streaming account and slot updates to subscribers. -## Setup -1. [Compile](#helper-scripts) or [download a release](https://github.com/jito-foundation/geyser-grpc-plugin/releases) for your specific validator version - - **NOTE**: Be sure to use the branch matching the major & minor versions of your RPC node. This includes using Solana Foundation or Jito validator -2. Copy and edit the [config json file](./server/example-config.json) to suit your validator -3. Add startup arg to solana validator - - Example: `--geyser-plugin-config geyser.json` -4. Restart validator -5. Check logs for `Starting GeyserPluginService from config files` or `geyser_grpc_plugin_server::server` - -## Directories - -### [server](./server) - -This where the server side logic lives i.e. implements the geyser-plugin-interface, wires up the gRPC service, and manages connections. -Note, what accounts are streamed is based on the configuration of the plugin via a [config json file](./server/example-config.json). - -#### API - -The following functions are exposed for clients to use. See **[geyser.proto](./proto/proto/geyser.proto)** for more details. - -##### get_heartbeat_interval - -Returns the server's configured heartbeat interval. Clients should consider the server unhealthy if some N consecutive heartbeats are missed. +## Building -##### subscribe_account_updates +When building for your validator, ensure the solana version library +matches the imported packages here. Also, ensure that the cargo +version (installed in rust-toolchain.toml) matches the rust-toolchain.toml +in the solana repository. -Subscribe to this endpoint if you're interested in receiving the entire account payload including the account's data bytes. +There are two options for building: -##### subscribe_partial_account_updates +For building using cargo: +```bash +$ cargo b --release +``` -This endpoint streams account updates similar to `subscribe_account_updates` except consuming much less bandwidth. You may want to -use this when you only care to be notified when an account is updated and don't necessarily care to what the actual state transition was. +For building in docker: +```bash +$ ./f +``` -##### subscribe_slot_updates +## Releasing +When releasing, ensure the version being released matches the solana version. +This keeps things simple :) -Notifies subscribers of slot state transitions i.e. processed, confirmed, rooted. +```bash +$ ./release +``` -#### Necessary Assumptions +## Releases +Releases built by CI can be found [here](https://github.com/jito-foundation/geyser-grpc-plugin/releases). +The release version should match the version of validator client you're running -The following assumptions __must__ be made: - -* Clients may receive data for slots out of order. -* Clients may receive account updates for a given slot out of order. - -### [proto](./proto) - -Contains the protobuf API definitions. - -### [client](./client) - -A simple gRPC client wrapper that takes an opinionated approach to how account updates shall be consumed. -Clients using this consumer can expect the following: - -1. Account updates will be streamed in monotonically; i.e. updates for older slots are discarded in the event that they were streamed by the server late. -2. Account updates received out of order will trigger an error. +## Running +1. Copy and edit the [config json file](./server/example-config.json) to suit your validator +1. Add startup arg to solana validator + - Example: `--geyser-plugin-config geyser.json` +1. Restart validator +1. Check logs for `Starting GeyserPluginService from config files` or `geyser_grpc_plugin_server::server` ### Helper Scripts @@ -64,5 +46,3 @@ For your convenience: * Run `./s` script to rsync to a server. * Run `./f` to build the binary within a container and spit out to a `container-output` folder. -* Run `./f jito-solana` if you plan on running it with a `jito-solana` node. - - Be sure to use the same `rustc` version used to build your RPC node as was used to build this. diff --git a/release b/release new file mode 100755 index 0000000..0410dd8 --- /dev/null +++ b/release @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +cargo workspaces version --all --exact --no-individual-tags \ No newline at end of file diff --git a/server/src/server.rs b/server/src/server.rs index 153133a..70ba47b 100644 --- a/server/src/server.rs +++ b/server/src/server.rs @@ -689,9 +689,8 @@ impl GeyserService { }); Ok(failed_account_update_sends - .into_iter() - .chain(failed_partial_account_update_sends.into_iter()) - .chain(failed_program_update_sends.into_iter()) + .chain(failed_partial_account_update_sends) + .chain(failed_program_update_sends) .collect()) } @@ -751,9 +750,9 @@ impl Geyser for GeyserService { &self, _request: Request, ) -> Result, Status> { - return Ok(Response::new(GetHeartbeatIntervalResponse { + Ok(Response::new(GetHeartbeatIntervalResponse { heartbeat_interval_ms: self.service_config.heartbeat_interval_ms, - })); + })) } type SubscribeAccountUpdatesStream = SubscriptionStream;