chore: release for chain v1.20.3 - #372
Conversation
📝 WalkthroughWalkthroughThe 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. ChangesExchange behavior and contracts
Build and dependency references
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (8)
chain/exchange/types/exchange.pb.gois excluded by!**/*.pb.gochain/exchange/types/tx.pb.gois excluded by!**/*.pb.gochain/exchange/types/v2/exchange.pb.gois excluded by!**/*.pb.gochain/exchange/types/v2/tx.pb.gois excluded by!**/*.pb.gochain/stream/types/query.pb.gois excluded by!**/*.pb.gochain/stream/types/v2/query.pb.gois excluded by!**/*.pb.goexchange/derivative_exchange_rpc/pb/goadesign_goagen_injective_derivative_exchange_rpc.pb.gois excluded by!**/*.pb.gogo.sumis excluded by!**/*.sum
📒 Files selected for processing (17)
Makefilechain/exchange/types/expected_keepers.gochain/exchange/types/v2/codec.gochain/exchange/types/v2/fee_discounts.gochain/exchange/types/v2/genesis.gochain/exchange/types/v2/market.gochain/exchange/types/v2/msgs.gochain/exchange/types/v2/proposal.gochain/exchange/types/v2/spot.gochain/exchange/types/v2/spot_orders.gogo.modproto/injective/exchange/v1beta1/exchange.protoproto/injective/exchange/v1beta1/tx.protoproto/injective/exchange/v2/exchange.protoproto/injective/exchange/v2/tx.protoproto/injective/stream/v1beta1/query.protoproto/injective/stream/v2/query.proto
| c.decrementQualifiedAccountVolume(account, amount) | ||
| c.decrementMakerMarketVolume(subaccountID, marketID, amount) |
There was a problem hiding this comment.
🗄️ 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.
| 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) |
There was a problem hiding this comment.
🗄️ 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.
| 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.
| 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 |
There was a problem hiding this comment.
🩺 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.3Repository: 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
doneRepository: 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.3Repository: 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 || trueRepository: 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:
- 1: https://github.com/InjectiveFoundation/injective-core/releases/tag/v1.20.3-1784976496
- 2: https://www.npmjs.com/package/@injectivelabs/indexer-proto-ts
- 3: https://docs.injective.network/developers-native/query-indexer-stream/index
- 4: https://github.com/InjectiveLabs/injective-ts/wiki/02QueryingIndexerSpot
- 5: [IC-1056] update-api-docs-for-v120-chain-upgrade api-exchange-docs#186
- 6: https://github.com/InjectiveFoundation/injective-core/releases
- 7: https://registry.npmjs.org/%40injectivelabs%2Findexer-proto-ts
🌐 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:
- 1: https://github.com/InjectiveFoundation/injective-core/releases/tag/v1.20.3-1784976496
- 2: https://newreleases.io/project/github/InjectiveFoundation/injective-core/release/v1.20.3-1784976496
- 3: https://docs.injective.network/infra/validator-mainnet/canonical-chain-upgrade-v1.20.3
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.
Summary by CodeRabbit
New Features
Bug Fixes