Skip to content

(feat) Updated proto definitions with Injective Core master branch (f…#362

Merged
aarmoa merged 1 commit into
devfrom
ic-1053/create-go-sdk-final-release-for-v120-testnet
May 15, 2026
Merged

(feat) Updated proto definitions with Injective Core master branch (f…#362
aarmoa merged 1 commit into
devfrom
ic-1053/create-go-sdk-final-release-for-v120-testnet

Conversation

@aarmoa
Copy link
Copy Markdown
Collaborator

@aarmoa aarmoa commented May 15, 2026

Updated proto definitions with Injective Core master branch (future v1.20 release) and Indexer v1.19.41.

  • Updated all proto definitions
  • Added new example script for MsgBatchLiquidatePositions
  • Added a documentation file (MAINTAINERS.md) to document the steps required to update proto definitions in the SDK for a chain upgrade

Summary by CodeRabbit

  • New Features

    • Added cross-margin trading support with subaccount risk profiles and cross-margin pool queries.
    • Introduced batch liquidation for derivative positions.
    • Added support for new oracle providers: Pyth Pro and SEDA Fast.
    • Enhanced Ethereum signature verification with stricter validation.
  • Chores

    • Updated dependency versions.
    • Removed outdated proto generation configuration files.

Review Change Stack

…uture v1.20 release) and Indexer v1.19.41.

- Updated all proto definitions
- Added new example script for MsgBatchLiquidatePositions
- Added a documentation file (MAINTAINERS.md) to document the steps required to update proto definitions in the SDK for a chain upgrade
@linear
Copy link
Copy Markdown

linear Bot commented May 15, 2026

IC-1053

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces cross-margin subaccount support, batch liquidation mechanics, enhanced Ethereum signature verification, and new oracle price feeds (Pyth Pro, Seda Fast, Coinbase) into the Injective SDK. It includes maintainer release documentation, comprehensive proto schema updates, and integration across exchange, oracle, and peggy modules.

Changes

Cross-Margin, Liquidation, and Oracle Release Bundle

Layer / File(s) Summary
Maintainer guide, build, and documentation
MAINTAINERS.md, Makefile, README.md
Adds complete maintainer release workflow documentation; updates Makefile to track upstream injective-core and injective-indexer revisions; moves proto/data maintenance guidance to dedicated MAINTAINERS.md; removes buf.gen.chain/indexer.yaml files.
Ethereum signature recovery and validation
chain/types/ethereum_signer.go, chain/types/errors.go
New strict signature normalization supporting 65-byte and Coinbase 96-byte formats; recovers addresses with low-S enforcement via StrictEthAddressFromSignature; new ErrInvalidEthereumSignature error type.
Exchange cross-margin type definitions and proto
proto/injective/exchange/v2/exchange.proto, proto/injective/exchange/v2/genesis.proto
Proto enums for RiskMode (isolated/cross) and ReservationPolicy; CrossMarginParams message with haircut, denom lists, market caps; SubaccountRiskProfile and SubaccountRiskProfileRecord for genesis persistence.
Exchange cross-margin params, messages, and genesis validation
chain/exchange/types/v2/params.go, chain/exchange/types/v2/genesis.go, chain/exchange/types/v2/market.go
Implements CrossMarginParams.Validate() with denom canonicalization and market cap enforcement; genesis validation for risk profiles including risk mode normalization and credit line rejection; market methods expose cross-margin eligibility.
Exchange batch and cross-margin liquidation messages
chain/exchange/types/v2/msgs.go, proto/injective/exchange/v2/tx.proto
New MsgBatchLiquidatePositions for batch position liquidation; MsgLiquidateCrossMarginPool for pool-level liquidation; MsgUpdateSubaccountRiskProfile for risk management; deprecated MsgSetDelegationTransferReceivers for backward compatibility; enhanced MsgUpdateDerivativeMarket with cross-margin eligibility updates.
Exchange derivative order and execution updates for cross-margin
chain/exchange/types/v2/derivative.go, chain/exchange/types/v2/derivative_orders.go, chain/exchange/types/v2/position.go
New IsAtomic() methods on derivative orders; derivative batch execution data includes CrossPoolSnapshotEvictions for eviction tracking; limit cancellation respects isCrossSubaccount callback to skip refunds for cross-margin orders; Position.Copy() performs deep cloning of decimal fields.
Exchange proposal and oracle validation enhancements
chain/exchange/types/proposal.go, chain/exchange/types/v2/proposal.proto
Proposal validation adds PythPro and SedaFast oracle type branches with canonical feed ID checks; provider oracle layout and reserved ID validation; cross-margin eligibility enum (tri-state with no-update option) in market update proposals.
Exchange types and key updates
chain/exchange/types/authz_common.go, chain/exchange/types/deposit.go, chain/exchange/types/errors.go, chain/exchange/types/expected_keepers.go, chain/exchange/types/key.go, chain/exchange/types/msgs.go, chain/exchange/types/params.go
New key prefixes for subaccount derivative market orders and risk profiles; NewUniformDepositDelta performs deep cloning; new error types ErrNotCanonicalLiquidationTarget and ErrMsgDeprecated; OracleKeeper interface replaces GetPrice with GetReferencePrice taking both base and quote; ValidateNonNegativeDec helper; authorization helper renamed from authorizeCancelAll to authorizeCancelAllMarkets.
Oracle new types: Pyth Pro, Seda Fast, Coinbase
chain/oracle/types/pyth_pro.go, chain/oracle/types/seda_fast.go, chain/oracle/types/coinbase_oracle.go, proto/injective/oracle/v1beta1/oracle.proto
Pyth Pro: canonical feed ID validation (decimal parse with round-trip equality); PythProPriceState with timestamp and embedded price state. Seda Fast: constants for update sizing (8KB, 64 updates, 18 exponent, 192 mantissa bits); feed ID validation (64-char lowercase hex); SedaFastPriceState and SedaFastParams with public key and program ID allowlists. Coinbase: public key constant, embedded ABI JSON, signature validation, and calldata parsing into CoinbasePriceState.
Oracle key/store definitions and parsing helpers
chain/oracle/types/key.go
Store prefixes for Chainlink Data Streams, Pyth Pro, Seda Fast; new ParseCoinbasePriceStoreIterKey; historical price record key builders GetSymbolHistoricalPriceRecordKey and parser ParseSymbolHistoricalPriceRecordKey; provider delimiter constants and compound key utilities JoinProviderCompoundKey, ParseProviderCompoundKey, ValidateProviderDerivativeOracleLayout; fixed-length key encoding for iterator suffix decoding.
Oracle parameter configuration and validation
chain/oracle/types/params.go
Pyth Pro parameters: verifier contract, gas limit, fee; SedaFast parameters with SEC1 public key validation and program ID canonicalization (64-char hex, duplication prevention across lists); oracle type string mappings for PythPro and SedaFast.
Oracle message types and codec registration
chain/oracle/types/msgs.go, chain/oracle/types/codec.go
New message types MsgRelayPythProPrices and MsgRelaySedaFastPrices with full sdk.Msg implementations; deprecated Band oracle messages (MsgRelayBandRates, MsgRequestBandIBCRates) with ValidateBasic rejection; stork asset ID empty check; codec registration for Amino and interface.
Oracle genesis state and query support
chain/oracle/types/genesis.go, proto/injective/oracle/v1beta1/genesis.proto, proto/injective/oracle/v1beta1/query.proto, proto/injective/oracle/v1beta1/events.proto
Genesis constructors and validation; new genesis fields for Pyth Pro and Seda Fast price states; query endpoints QueryPythProPriceStates and QuerySedaFastPriceStates; generic EventOraclePriceUpdate event type.
Oracle Stork type and signature verification updates
chain/oracle/types/stork.go, chain/oracle/types/stork_oracle.go, chain/oracle/types/oracle.go
Stork price state constructors and update methods with monotonic timestamp enforcement; price scaling to eighteen decimals; reserved provider ID validation (rejects "USD" and delimiter-containing IDs); MaxSymbolsPerCleanupRound constant; GetOracleType extended with PythPro and SedaFast mappings; stork verification uses StrictEthAddressFromSignature.
Oracle expected keeper interfaces
chain/oracle/types/expected_keepers.go
BankKeeper with balance/transfer/burn methods; EVMKeeper with EthCall for Data Streams verification.
Peggy module signature and key updates
chain/peggy/types/ethereum_signer.go, chain/peggy/types/key.go, chain/peggy/types/msgs.go, chain/peggy/types/params.go
Ethereum signer refactored to delegate to chaintypes.StrictEthAddressFromSignature; fee indexing key scheme with big-endian txID encoding; jailed tracking keys (replacing slashed equivalents); signature hex-decode and 65-byte validation in confirmations; deprecated slash-fraction parameters marked with no-op validators.
Example code, data updates, and module dependencies
examples/chain/exchange/31_MsgBatchLiquidatePositions/example.go, injective_data/chain_messages_list.json, go.mod
New batch liquidation example demonstrating MsgBatchLiquidatePositions creation and broadcast; message type registry updated with liquidation and oracle message entries; metrics module bumped from v2.0.0-beta.8 to v2.0.0-beta.9.
Proto event and market field additions
proto/injective/exchange/v1beta1/events.proto, proto/injective/exchange/v2/events.proto, proto/injective/exchange/v2/market.proto, proto/injective/stream/v2/query.proto
Cross-pool liquidation loss events in v1beta1 and v2; subaccount risk profile update events; forced settlement indicator in settlement info; derivative trade liquidation indicator; position response fields now include risk_mode.
Codec registrations for new message types
chain/exchange/types/v2/codec.go
Amino and interface codec registrations for MsgUpdateSubaccountRiskProfile, MsgBatchLiquidatePositions, MsgLiquidateCrossMarginPool, MsgSetDelegationTransferReceivers, and oracle relay messages.
Proto query and transaction service definitions
proto/injective/exchange/v2/query.proto, proto/injective/exchange/v2/proposal.proto, proto/injective/oracle/v1beta1/proposal.proto, proto/injective/oracle/v1beta1/tx.proto, proto/injective/peggy/v1/params.proto
Query services for subaccount risk profiles and cross-margin pool snapshots; transaction services for batch/cross-margin liquidation and risk profile updates; deprecated proposal field formatting; oracle relay RPCs for Pyth Pro and Seda Fast; Peggy slash-fraction parameters marked deprecated.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • InjectiveLabs/sdk-go#359: Both PRs modify the Makefile's upstream clone/copy pipeline for the copy-chain-types oracle types copying logic, so the release/update mechanics are directly related.

Poem

🐇 Whiskers twitch with delight,
Cross-margins now flow in the night,
Oracles sing with Pyth's might,
Signatures strict, validations right,
Liquidations in batch—what a sight! 🚀

✨ 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 ic-1053/create-go-sdk-final-release-for-v120-testnet

@aarmoa aarmoa merged commit 735b288 into dev May 15, 2026
5 of 6 checks passed
@aarmoa aarmoa deleted the ic-1053/create-go-sdk-final-release-for-v120-testnet branch May 15, 2026 19:20
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