Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jito async searcher unnecessary authentication problem #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jito_geyser/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ protobuf = "^4.21.12"
isort = "^5.11.4"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.poetry-grpc-plugin]
proto_path = "../geyser-grpc-plugin/proto/proto"
Expand Down
19 changes: 10 additions & 9 deletions jito_searcher_client/jito_searcher_client/async_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ async def intercept_unary_stream(
if self._kp != None:
await self.authenticate_if_needed()

client_call_details = self._insert_headers(
[("authorization", f"Bearer {self._access_token.token}")],
client_call_details,
)
client_call_details = self._insert_headers(
[("authorization", f"Bearer {self._access_token.token}")],
client_call_details,
)

call = await continuation(client_call_details, request)

Expand All @@ -77,10 +77,10 @@ async def intercept_unary_unary(
if self._kp != None:
await self.authenticate_if_needed()

client_call_details = self._insert_headers(
[("authorization", f"Bearer {self._access_token.token}")],
client_call_details,
)
client_call_details = self._insert_headers(
[("authorization", f"Bearer {self._access_token.token}")],
client_call_details,
)

undone_call = await continuation(client_call_details, request)
response = await undone_call
Expand Down Expand Up @@ -173,7 +173,8 @@ async def get_async_searcher_client(url: str, kp: Keypair=None) -> SearcherServi
"""
# Authenticate immediately
searcher_interceptor = AsyncSearcherInterceptor(url, kp)
await searcher_interceptor.authenticate_if_needed()
if kp != None:
await searcher_interceptor.authenticate_if_needed()

credentials = ssl_channel_credentials()
channel = secure_channel(url, credentials, interceptors=[searcher_interceptor])
Expand Down
4 changes: 2 additions & 2 deletions jito_searcher_client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ click = "^8.1.3"
solana = "0.34.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.poetry-grpc-plugin]
proto_path = "../mev-protos"
Expand Down