Skip to content

chore: release for chain v1.20.3 - #372

Merged
dbrajovic merged 4 commits into
masterfrom
chore/release-for-chain-1.20.3
Jul 28, 2026
Merged

chore: release for chain v1.20.3#372
dbrajovic merged 4 commits into
masterfrom
chore/release-for-chain-1.20.3

Conversation

@dbrajovic

@dbrajovic dbrajovic commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added settled trade notional amounts to trade logs, spot order results, and streaming trade data.
    • Enabled setting delegation transfer receivers through a supported transaction endpoint.
    • Added support for reversing maker volume contributions used in fee discount calculations.
  • Bug Fixes

    • Improved validation for spot market tick sizes, order notionals, and genesis spot orderbook data.
    • Prevented invalid or negative volume contributions from affecting fee discount calculations.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The exchange update adds settled notional fields across trade and order-result schemas, centralizes spot tick-size validation, validates spot orderbooks during genesis checks, enables delegation receiver messages, adds maker-volume decrements, and updates repository and dependency revisions.

Changes

Exchange behavior and contracts

Layer / File(s) Summary
Settlement notional contracts and propagation
proto/injective/exchange/..., proto/injective/stream/..., chain/exchange/types/v2/spot.go
Trade logs, spot trade streams, and spot order results now expose settled notional values, which are populated from spot execution state.
Spot tick-size and notional validation
chain/exchange/types/v2/market.go, chain/exchange/types/v2/msgs.go, chain/exchange/types/v2/proposal.go, chain/exchange/types/v2/spot_orders.go, chain/exchange/types/v2/genesis.go
Spot validation uses combined tick-size checks, rejects non-positive order notional, and validates spot orderbook markets and orders during genesis validation.
Delegation receiver transaction flow
chain/exchange/types/expected_keepers.go, chain/exchange/types/v2/{codec.go,msgs.go}, proto/injective/exchange/v2/tx.proto
Delegation receiver messages are no longer deprecated, validate sender and receiver addresses, and are exposed through the v2 transaction service.
Maker-volume contribution decrement
chain/exchange/types/v2/fee_discounts.go
Fee discount accounting decrements account and subaccount maker-volume contributions with clamping and zero-entry cleanup.

Build and dependency references

Layer / File(s) Summary
Repository release references
Makefile, go.mod
Clone targets and Cardano light-client module references are updated to newer revisions.

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

Suggested reviewers: aarmoa

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 is concise and accurately describes the release-focused changes for 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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/release-for-chain-1.20.3

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@chain/exchange/types/v2/fee_discounts.go`:
- Around line 179-180: Update decrementMakerMarketVolume to return the effective
maker-volume reduction after verifying the record and applying clamping, then
pass that returned delta to decrementQualifiedAccountVolume instead of the
original amount in the surrounding reversal flow. Ensure missing records or
oversized/duplicate reversals leave the account aggregate unchanged or reduce it
only by the amount actually removed.

In `@chain/exchange/types/v2/genesis.go`:
- Around line 88-92: Update the persisted order validation alongside the
existing OrderInfo.Price and Fillable checks to also validate OrderInfo.Quantity
with market.MinQuantityTickSize using BreachesMinimumTickSize. Return the same
order-context error when Quantity is nil or off-tick, preserving the existing
Fillable validation.

In `@Makefile`:
- Around line 3-4: Update the Makefile clone targets for injective-indexer and
injective-core to use reachable public repository URLs, and change the
injective-core checkout from v1.20.3 to the actual public release tag. Preserve
the existing shallow, single-branch clone behavior.
🪄 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: 6f3b1fde-c51a-4cc2-a7a3-d3b15c54d3ef

📥 Commits

Reviewing files that changed from the base of the PR and between 00efb6b and 4459d02.

⛔ Files ignored due to path filters (8)
  • chain/exchange/types/exchange.pb.go is excluded by !**/*.pb.go
  • chain/exchange/types/tx.pb.go is excluded by !**/*.pb.go
  • chain/exchange/types/v2/exchange.pb.go is excluded by !**/*.pb.go
  • chain/exchange/types/v2/tx.pb.go is excluded by !**/*.pb.go
  • chain/stream/types/query.pb.go is excluded by !**/*.pb.go
  • chain/stream/types/v2/query.pb.go is excluded by !**/*.pb.go
  • exchange/derivative_exchange_rpc/pb/goadesign_goagen_injective_derivative_exchange_rpc.pb.go is excluded by !**/*.pb.go
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (17)
  • Makefile
  • chain/exchange/types/expected_keepers.go
  • chain/exchange/types/v2/codec.go
  • chain/exchange/types/v2/fee_discounts.go
  • chain/exchange/types/v2/genesis.go
  • chain/exchange/types/v2/market.go
  • chain/exchange/types/v2/msgs.go
  • chain/exchange/types/v2/proposal.go
  • chain/exchange/types/v2/spot.go
  • chain/exchange/types/v2/spot_orders.go
  • go.mod
  • proto/injective/exchange/v1beta1/exchange.proto
  • proto/injective/exchange/v1beta1/tx.proto
  • proto/injective/exchange/v2/exchange.proto
  • proto/injective/exchange/v2/tx.proto
  • proto/injective/stream/v1beta1/query.proto
  • proto/injective/stream/v2/query.proto

Comment on lines +179 to +180
c.decrementQualifiedAccountVolume(account, amount)
c.decrementMakerMarketVolume(subaccountID, marketID, amount)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Decrement the account aggregate by the actual maker-volume reduction.

Line 179 subtracts amount before Line 180 verifies a maker record exists or clamps the reduction. Duplicate/oversized reversals can reduce AccountVolumeContributions while maker volume remains unchanged or only partially decreases, corrupting fee-discount eligibility. Have decrementMakerMarketVolume return the effective clamped delta, then apply that delta to the account aggregate.

🤖 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 `@chain/exchange/types/v2/fee_discounts.go` around lines 179 - 180, Update
decrementMakerMarketVolume to return the effective maker-volume reduction after
verifying the record and applying clamping, then pass that returned delta to
decrementQualifiedAccountVolume instead of the original amount in the
surrounding reversal flow. Ensure missing records or oversized/duplicate
reversals leave the account aggregate unchanged or reduce it only by the amount
actually removed.

Comment on lines +88 to +92
if order.OrderInfo.Price.IsNil() || types.BreachesMinimumTickSize(order.OrderInfo.Price, market.MinPriceTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: price does not match market tick size", i, j)
}
if order.Fillable.IsNil() || types.BreachesMinimumTickSize(order.Fillable, market.MinQuantityTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: fillable does not match market tick size", i, j)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Validate the persisted order quantity tick size.

OrderInfo.Quantity is never checked. A genesis order can therefore retain an off-tick original quantity while Fillable is on-tick, violating the order-state invariant.

Proposed fix
 		if order.OrderInfo.Price.IsNil() || types.BreachesMinimumTickSize(order.OrderInfo.Price, market.MinPriceTickSize) {
 			return fmt.Errorf("spot_orderbook[%d].orders[%d]: price does not match market tick size", i, j)
 		}
+		if order.OrderInfo.Quantity.IsNil() || types.BreachesMinimumTickSize(order.OrderInfo.Quantity, market.MinQuantityTickSize) {
+			return fmt.Errorf("spot_orderbook[%d].orders[%d]: quantity does not match market tick size", i, j)
+		}
 		if order.Fillable.IsNil() || types.BreachesMinimumTickSize(order.Fillable, market.MinQuantityTickSize) {
 			return fmt.Errorf("spot_orderbook[%d].orders[%d]: fillable does not match market tick size", i, j)
 		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if order.OrderInfo.Price.IsNil() || types.BreachesMinimumTickSize(order.OrderInfo.Price, market.MinPriceTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: price does not match market tick size", i, j)
}
if order.Fillable.IsNil() || types.BreachesMinimumTickSize(order.Fillable, market.MinQuantityTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: fillable does not match market tick size", i, j)
if order.OrderInfo.Price.IsNil() || types.BreachesMinimumTickSize(order.OrderInfo.Price, market.MinPriceTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: price does not match market tick size", i, j)
}
if order.OrderInfo.Quantity.IsNil() || types.BreachesMinimumTickSize(order.OrderInfo.Quantity, market.MinQuantityTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: quantity does not match market tick size", i, j)
}
if order.Fillable.IsNil() || types.BreachesMinimumTickSize(order.Fillable, market.MinQuantityTickSize) {
return fmt.Errorf("spot_orderbook[%d].orders[%d]: fillable does not match market tick size", i, j)
}
🤖 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 `@chain/exchange/types/v2/genesis.go` around lines 88 - 92, Update the
persisted order validation alongside the existing OrderInfo.Price and Fillable
checks to also validate OrderInfo.Quantity with market.MinQuantityTickSize using
BreachesMinimumTickSize. Return the same order-context error when Quantity is
nil or off-tick, preserving the existing Fillable validation.

Comment thread Makefile
Comment on lines 3 to +4
clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.20.49 --depth 1 --single-branch
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.20.89 --depth 1 --single-branch

Copy link
Copy Markdown

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:

#!/usr/bin/env bash
set -euo pipefail

git ls-remote --exit-code --refs \
  https://github.com/InjectiveLabs/injective-indexer.git \
  refs/tags/v1.20.89

git ls-remote --exit-code --refs \
  https://github.com/InjectiveLabs/injective-core.git \
  refs/tags/v1.20.3

Repository: InjectiveLabs/sdk-go

Length of output: 278


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== Makefile excerpt =="
nl -ba Makefile | sed -n '1,20p'

echo
echo "== Remote refs =="
for repo in \
  https://github.com/InjectiveLabs/injective-indexer.git \
  https://github.com/InjectiveLabs/injective-core.git
do
  printf '\n%s\n' "$repo"
  git ls-remote --exit-code --refs "$repo" refs/tags/v1.20.89 refs/tags/v1.20.3 || true
done

Repository: InjectiveLabs/sdk-go

Length of output: 221


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== Makefile excerpt =="
sed -n '1,20p' Makefile | cat -n

echo
echo "== injective-indexer tag =="
git ls-remote --exit-code --refs \
  https://github.com/InjectiveLabs/injective-indexer.git \
  refs/tags/v1.20.89

echo
echo "== injective-core tag =="
git ls-remote --exit-code --refs \
  https://github.com/InjectiveLabs/injective-core.git \
  refs/tags/v1.20.3

Repository: InjectiveLabs/sdk-go

Length of output: 1155


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '== Makefile excerpt ==\n'
sed -n '1,20p' Makefile | cat -n

printf '\n== injective-indexer tag ==\n'
git ls-remote --exit-code --refs \
  https://github.com/InjectiveLabs/injective-indexer.git \
  refs/tags/v1.20.89 || true

printf '\n== injective-core tag ==\n'
git ls-remote --exit-code --refs \
  https://github.com/InjectiveLabs/injective-core.git \
  refs/tags/v1.20.3 || true

Repository: InjectiveLabs/sdk-go

Length of output: 1290


🌐 Web query:

InjectiveLabs injective-indexer v1.20.89 repository tag

💡 Result:

As of July 28, 2026, there is no public repository tag for "v1.20.89" in the official InjectiveLabs/injective-indexer repository. Injective's technical infrastructure and releases are primarily tracked through the following repositories: 1. InjectiveFoundation/injective-core: This repository manages the core blockchain releases. Recent releases include versions such as v1.20.3 [1]. 2. InjectiveLabs/injective-indexer: While this repository contains the indexer code, development and versioning for external developers are often managed via SDKs, such as @injectivelabs/indexer-proto-ts or the broader @injectivelabs/sdk-ts package, rather than direct repository tags for the indexer service itself [2][3][4]. 3. InjectiveLabs/api-exchange-docs: This repository tracks component version dependencies for upgrades. Documentation for the v1.20.0 chain upgrade recently referenced Indexer version v1.20.2 [5]. The specific version "v1.20.89" does not appear in official release documentation or public version history associated with the Injective indexer services [6][1][5][7]. It is possible that this version number refers to an internal build, a misidentified dependency, or is outside the current public release sequence.

Citations:


🌐 Web query:

InjectiveLabs injective-core v1.20.3 repository tag

💡 Result:

The official release tag for Injective core version 1.20.3 in the InjectiveFoundation/injective-core repository is v1.20.3-1784976496 [1][2]. This release, which serves as the Injective v1.20.3 Mainnet Upgrade, was published on July 25, 2026 [1][2]. The release includes the injectived and peggo binaries, both of which are associated with the code commit 5c3143e [1][3]. The binaries are built using Go version 1.26.4 [1][3]. For validator upgrades and installation, official documentation recommends using the binaries provided in this release, which are also available via the Docker image injectivelabs/injective-core:v1.20.3 [1][3].

Citations:


Update the clone URLs and release refs The InjectiveLabs/injective-indexer.git and InjectiveLabs/injective-core.git targets are unreachable, so these Makefile rules will fail as written. injective-core also needs to point at the actual public release tag rather than v1.20.3.

🤖 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 `@Makefile` around lines 3 - 4, Update the Makefile clone targets for
injective-indexer and injective-core to use reachable public repository URLs,
and change the injective-core checkout from v1.20.3 to the actual public release
tag. Preserve the existing shallow, single-branch clone behavior.

@dbrajovic
dbrajovic merged commit f946983 into master Jul 28, 2026
6 checks passed
@dbrajovic
dbrajovic deleted the chore/release-for-chain-1.20.3 branch July 28, 2026 17:39
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