Skip to content

chore: release for chain v1.20.3 - #421

Merged
dbrajovic merged 3 commits into
masterfrom
chore/release-for-v1.20.3
Jul 29, 2026
Merged

chore: release for chain v1.20.3#421
dbrajovic merged 3 commits into
masterfrom
chore/release-for-v1.20.3

Conversation

@dbrajovic

@dbrajovic dbrajovic commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Reflect chain changes for a new sdk-python release (v1.16.1)

Summary by CodeRabbit

  • New Features
    • Added Markets retrieval to the derivatives API.
    • Added delegation transfer receiver configuration support.
    • Added notional values to spot trade data.
    • Expanded derivative position data with initial leverage, margin, entry price, and quantity.
  • Bug Fixes
    • Updated exchange/derivatives API compatibility with the latest protocol definitions.
  • Tests
    • Updated expectations for stream and position payloads to include the new fields.
  • Chores
    • Bumped package version to 1.16.1 and tightened Poetry version constraints in CI/package builds.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated upstream proto inputs and regenerated Python protobuf/gRPC bindings. Added derivative Markets and delegation-transfer RPC plumbing, propagated trade and position fields through descriptors, updated related tests, CI configuration, and bumped the package version to 1.16.1.

Changes

Protocol and RPC update

Layer / File(s) Summary
Upstream inputs and derivative Markets RPC
Makefile, buf.gen.yaml, pyinjective/proto/exchange/*derivatives*
Dependency tags and generated derivative contracts are updated with market messages and the Markets gRPC method.
Trade and position schema propagation
pyinjective/proto/injective/exchange/..., pyinjective/proto/injective/stream/..., tests/client/...
Generated descriptors register notional and updated position fields, while API and stream tests assert the expanded payloads.
Delegation transfer RPC binding
pyinjective/proto/injective/exchange/v2/tx_pb2*
Generated transaction descriptors and gRPC bindings add SetDelegationTransferReceivers across client and server registration points.
Release and CI configuration
pyproject.toml, .github/workflows/*
The package version, build constraint, Poetry version range, and virtualenv cache inputs are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant InjectiveTCDerivativesRPCStub
  participant InjectiveTCDerivativesRPCServicer
  Client->>InjectiveTCDerivativesRPCStub: Send MarketsRequest
  InjectiveTCDerivativesRPCStub->>InjectiveTCDerivativesRPCServicer: Invoke Markets
  InjectiveTCDerivativesRPCServicer-->>InjectiveTCDerivativesRPCStub: Return MarketsResponse or UNIMPLEMENTED
  InjectiveTCDerivativesRPCStub-->>Client: Deliver response
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the release-focused changes and correctly references chain v1.20.3.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/release-for-v1.20.3

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py (1)

265-265: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use non-default notional values in both stream fixtures.

Both expected values are derived from SpotTrade objects whose notional remains the protobuf default ""; a broken conversion can therefore pass unnoticed.

  • tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py#L265-L265: set a concrete v1 spot_trade.notional and assert it.
  • tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py#L674-L674: set a concrete v2 spot_trade.notional and assert it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py` at line 265,
Update both stream fixtures in
tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py: in the v1
fixture around lines 265 and the v2 fixture around line 674, assign concrete
non-default values to each SpotTrade object's notional field and assert those
same values in the expected results. Ensure both versions validate conversion of
populated notional values rather than the protobuf default.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py`:
- Around line 768-771: Update the position fixtures in
tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py:768-771 and
tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py:876-879
to assign distinct non-default values to initialLeverage, initialMargin,
initialEntryPrice, and initialQuantity, ensuring both derivative API and stream
tests validate propagation and serialization.

---

Nitpick comments:
In `@tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py`:
- Line 265: Update both stream fixtures in
tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py: in the v1
fixture around lines 265 and the v2 fixture around line 674, assign concrete
non-default values to each SpotTrade object's notional field and assert those
same values in the expected results. Ensure both versions validate conversion of
populated notional values rather than the protobuf default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2486631a-a712-467c-a033-ae6792b2b372

📥 Commits

Reviewing files that changed from the base of the PR and between 4ee1dd3 and 438a09d.

📒 Files selected for processing (16)
  • Makefile
  • buf.gen.yaml
  • pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py
  • pyinjective/proto/exchange/injective_tc_derivatives_rpc_pb2.py
  • pyinjective/proto/exchange/injective_tc_derivatives_rpc_pb2_grpc.py
  • pyinjective/proto/injective/exchange/v1beta1/exchange_pb2.py
  • pyinjective/proto/injective/exchange/v1beta1/tx_pb2.py
  • pyinjective/proto/injective/exchange/v2/exchange_pb2.py
  • pyinjective/proto/injective/exchange/v2/tx_pb2.py
  • pyinjective/proto/injective/exchange/v2/tx_pb2_grpc.py
  • pyinjective/proto/injective/stream/v1beta1/query_pb2.py
  • pyinjective/proto/injective/stream/v2/query_pb2.py
  • pyproject.toml
  • tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py
  • tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py
  • tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py

Comment on lines +768 to +771
"initialLeverage": position.initial_leverage,
"initialMargin": position.initial_margin,
"initialEntryPrice": position.initial_entry_price,
"initialQuantity": position.initial_quantity,

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Use non-default values for the new position fields.

Both tests currently assert protobuf defaults, so they do not reliably detect incorrect propagation or serialization.

  • tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py#L768-L771: initialize all four initial_* fields with distinct values.
  • tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py#L876-L879: initialize the same four fields in the stream fixture.
📍 Affects 2 files
  • tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py#L768-L771 (this comment)
  • tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py#L876-L879
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py` around lines
768 - 771, Update the position fixtures in
tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py:768-771 and
tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py:876-879
to assign distinct non-default values to initialLeverage, initialMargin,
initialEntryPrice, and initialQuantity, ensuring both derivative API and stream
tests validate propagation and serialization.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/pre-commit.yml (1)

18-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use one exact, tested Poetry version across all workflows.

The >=2.4,<3 range permits tooling behavior to change between runs. Define a shared exact version and use it in pre-commit, test, and release workflows to keep validation and published artifacts reproducible.

  • .github/workflows/pre-commit.yml#L18-L18: pin the Poetry version used by pre-commit.
  • .github/workflows/release.yml#L17-L17: use the same pinned Poetry version for publishing.
  • .github/workflows/run-tests.yml#L30-L30: use the same pinned Poetry version for tests.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pre-commit.yml at line 18, Define one shared exact, tested
Poetry version and replace the version range in the install steps at
.github/workflows/pre-commit.yml lines 18-18, .github/workflows/release.yml
lines 17-17, and .github/workflows/run-tests.yml lines 30-30 with that same
pinned version, ensuring all workflows use identical reproducible tooling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pre-commit.yml:
- Around line 20-24: Update the cache key in the cache-venv step to include the
resolved Python version configured by setup-python, ensuring virtual-environment
caches are separated by interpreter version while preserving the existing OS and
dependency-file hash components.

In @.github/workflows/release.yml:
- Around line 14-17: Set an explicit supported interpreter in the “Install
Python” setup-python step by adding the python-version configuration; do not
rely on the runner PATH or repository defaults. Keep the existing Poetry
installation step unchanged.

---

Nitpick comments:
In @.github/workflows/pre-commit.yml:
- Line 18: Define one shared exact, tested Poetry version and replace the
version range in the install steps at .github/workflows/pre-commit.yml lines
18-18, .github/workflows/release.yml lines 17-17, and
.github/workflows/run-tests.yml lines 30-30 with that same pinned version,
ensuring all workflows use identical reproducible tooling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 61e05fb9-e087-404e-9f71-c7a72e50dd96

📥 Commits

Reviewing files that changed from the base of the PR and between 438a09d and 35ab170.

📒 Files selected for processing (4)
  • .github/workflows/pre-commit.yml
  • .github/workflows/release.yml
  • .github/workflows/run-tests.yml
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml

Comment on lines 20 to +24
id: cache-venv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock', '**/pyproject.toml', '**/poetry.toml') }}

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '1,120p' .github/workflows/pre-commit.yml | cat -n

Repository: InjectiveLabs/sdk-python

Length of output: 1314


🏁 Script executed:

cat -n .github/workflows/pre-commit.yml

Repository: InjectiveLabs/sdk-python

Length of output: 1314


🏁 Script executed:

python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/pre-commit.yml')
print(p.exists())
if p.exists():
    print(p.read_text())
PY

Repository: InjectiveLabs/sdk-python

Length of output: 1089


Include the resolved Python version in the .venv cache key. The current key is shared across all versions that satisfy >=3.9 <3.12, so a cache built under one interpreter can be restored under another. Add the resolved setup-python version to the key, or pin the workflow to an exact version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pre-commit.yml around lines 20 - 24, Update the cache key
in the cache-venv step to include the resolved Python version configured by
setup-python, ensuring virtual-environment caches are separated by interpreter
version while preserving the existing OS and dependency-file hash components.

Comment on lines 14 to +17
- name: Install Python
uses: actions/setup-python@v5
- name: Install poetry
run: python -m pip install poetry
run: python -m pip install "poetry>=2.4,<3"

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== release workflow excerpt ==="
sed -n '1,80p' .github/workflows/release.yml

echo
echo "=== python version declarations ==="
rg -n --hidden --glob '!**/.git/**' -e 'python-version|requires-python|tool\.poetry\.dependencies|Programming Language :: Python ::' pyproject.toml poetry.lock .github/workflows README* .python-version .tool-versions setup.cfg setup.py 2>/dev/null || true

echo
echo "=== candidate config files ==="
fd -H -a 'pyproject.toml|poetry.lock|.python-version|.tool-versions|setup.cfg|setup.py' .

Repository: InjectiveLabs/sdk-python

Length of output: 5335


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== pyproject.toml excerpt ==="
sed -n '1,120p' pyproject.toml

echo
echo "=== workflow files using setup-python ==="
rg -n "actions/setup-python@|python-version:" .github/workflows

Repository: InjectiveLabs/sdk-python

Length of output: 2904


🌐 Web query:

actions/setup-python v5 default python-version omitted behavior documentation

💡 Result:

In actions/setup-python v5, the python-version input is optional [1][2]. If this input is omitted, the action follows a specific fallback behavior to determine which Python version to use: 1. File-based resolution: The action first attempts to read the version from a.python-version file in the repository root [1][3]. 2. PATH fallback: If no.python-version file exists, the action will use the Python or PyPy version currently available in the PATH [1][4]. Because the default version present in the PATH can vary between different runner images and may change unexpectedly over time, the official documentation strongly recommends that you always explicitly specify a Python version using the python-version or python-version-file inputs to ensure build consistency [1][5].

Citations:


Pin the release Python version. .github/workflows/release.yml:14-17 falls back to the runner PATH here, and there’s no .python-version file in the repo, so release builds can drift with the hosted image. Set python-version explicitly to a supported release interpreter.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 14 - 17, Set an explicit
supported interpreter in the “Install Python” setup-python step by adding the
python-version configuration; do not rely on the runner PATH or repository
defaults. Keep the existing Poetry installation step unchanged.

@dbrajovic
dbrajovic merged commit ebbb328 into master Jul 29, 2026
14 checks passed
@dbrajovic
dbrajovic deleted the chore/release-for-v1.20.3 branch July 29, 2026 10:52
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.

1 participant