Skip to content

feat: add asyncio-native AsyncLedgerClient (gRPC, no thread wrapping) - #443

Merged
MissingNO57 merged 8 commits into
mainfrom
feat/async_client
Jul 27, 2026
Merged

feat: add asyncio-native AsyncLedgerClient (gRPC, no thread wrapping)#443
MissingNO57 merged 8 commits into
mainfrom
feat/async_client

Conversation

@MissingNO57

Copy link
Copy Markdown
Contributor

Extract the I/O-free logic of LedgerClient (parsers, fee math, stub wiring, poll timings) into a shared LedgerClientBase and add AsyncLedgerClient, which runs the same generated protobuf stubs over a grpc.aio channel. The sync client is a pure refactor - no API or behavior changes.

  • cosmpy/aerial/client/base.py: shared I/O-free base for both clients
  • cosmpy/aerial/client/aio.py: AsyncLedgerClient + async tx helpers (prepare_and_broadcast_basic_transaction, simulate_tx, get_paginated); gRPC endpoints only, REST URLs raise with a clear message
  • gas.py: AsyncGasStrategy and AsyncSimulationGasStrategy; async client also accepts I/O-free sync strategies (e.g. OfflineMessageTableStrategy)
  • tx_helpers.py: AsyncSubmittedTx with awaitable wait_to_complete()
  • tests: async client unit tests over mocked aio stubs

Proposed Changes

[describe the changes here...]

Linked Issues

[if applicable, add links to issues resolved by this PR]

Types of changes

What type of change does this pull request make (put an x in the boxes that apply)?

  • Bug fix (non-breaking change that fixes an issue).
  • New feature added (non-breaking change that adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to stop working as expected).
  • Documentation update.
  • Something else (e.g., tests, scripts, example, deployment, infrastructure).

Checklist

Put an x in the boxes that apply:

  • I have read the CONTRIBUTING guide
  • Checks and tests pass locally

If applicable

  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that code coverage does not decrease
  • I have added/updated the documentation

Further comments

[if this is a relatively large or complex change, kick off a discussion by explaining why you chose the solution you did, what alternatives you considered, etc...]

Extract the I/O-free logic of LedgerClient (parsers, fee math, stub
wiring, poll timings) into a shared LedgerClientBase and add
AsyncLedgerClient, which runs the same generated protobuf stubs over a
grpc.aio channel. The sync client is a pure refactor - no API or
behavior changes.

- cosmpy/aerial/client/base.py: shared I/O-free base for both clients
- cosmpy/aerial/client/aio.py: AsyncLedgerClient + async tx helpers
  (prepare_and_broadcast_basic_transaction, simulate_tx, get_paginated);
  gRPC endpoints only, REST URLs raise with a clear message
- gas.py: AsyncGasStrategy and AsyncSimulationGasStrategy; async client
  also accepts I/O-free sync strategies (e.g. OfflineMessageTableStrategy)
- tx_helpers.py: AsyncSubmittedTx with awaitable wait_to_complete()
- tests: async client unit tests over mocked aio stubs

@pbukva pbukva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 1af8238):

https://fetch-docs-preview--pr443-feat-async-client-eiza1cm6.web.app

(expires Wed, 29 Jul 2026 09:40:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f2de39fd4e81249941960b74fbab0a62d90d69f8

@MissingNO57
MissingNO57 merged commit 4c755b0 into main Jul 27, 2026
33 checks passed
@MissingNO57
MissingNO57 deleted the feat/async_client branch July 27, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants