Skip to content

[CHORE] Update Injective Core to v1.18.0-beta2#345

Merged
aarmoa merged 2 commits intodevfrom
chore/update_injective_core_v1_18_0_beta2
Feb 8, 2026
Merged

[CHORE] Update Injective Core to v1.18.0-beta2#345
aarmoa merged 2 commits intodevfrom
chore/update_injective_core_v1_18_0_beta2

Conversation

@aarmoa
Copy link
Copy Markdown
Collaborator

@aarmoa aarmoa commented Feb 8, 2026

Update Injective Core to v1.18.0-beta2

Summary by CodeRabbit

  • New Features

    • Enforced-restrictions contracts with pause-event tracking for exchange enforcement.
    • Partial order cancellation tracking for derivative matching and batches.
    • Permissions keeper interface for address restriction checks.
    • Batch checkpoint generation for Ethereum signing compatibility.
    • Expanded execution type variants for exchange settlements.
  • Deprecations

    • Band oracle proposals marked deprecated; related governance proposals return a deprecated error.
  • Chores

    • Updated core repository reference and module replacements; added proto registration and interface annotations; updated NOTICE copyright.

@aarmoa aarmoa requested a review from Copilot February 8, 2026 02:45
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 8, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Updates include dependency and Makefile edits, new exchange keeper interface and derivative partial-cancel tracking, deprecated Band oracle proposal support, peggy batch checkpoint creation and proto interface annotations across EVM/peggy/exchange/oracle modules, plus several proto file option adjustments.

Changes

Cohort / File(s) Summary
Build & Tooling
Makefile, go.mod, NOTICE.md
Bumped injected core reference in Makefile; added peggy file copy in Makefile; updated module replacements and removed a dependency in go.mod; updated copyright year in NOTICE.md.
Exchange — Keeper & Matching Data
chain/exchange/types/expected_keepers.go, chain/exchange/types/v2/common_utils.go, chain/exchange/types/v2/derivative.go, chain/exchange/types/v2/params.go
Added exported PermissionsKeeper interface; reordered an import; added PartialCancelOrders to matching/batch structs with setters and initialization; introduced ValidateEnforcedRestrictionsContracts and wired it into Params.Validate. Review initialization and persistence of partial-cancel maps and validation logic.
Oracle — Deprecated Band Proposals
chain/oracle/types/codec.go, chain/oracle/types/errors.go, chain/oracle/types/proposal.go, proto/injective/oracle/v1beta1/proposal.proto
Registered legacy Band proposal proto/types and added implementations marked deprecated; introduced ErrBandOracleDeprecated and made legacy proposals return that error in ValidateBasic. Verify deprecation handling and codec/interface registrations.
Peggy — Ethereum-signed & Batch Checkpoint
chain/peggy/types/batch.go, chain/peggy/types/codec.go, proto/injective/peggy/v1/batch.proto, proto/injective/peggy/v1/msgs.proto, proto/injective/peggy/v1/types.proto, proto/injective/peggy/v1/attestation.proto
Added GetCheckpoint(peggyIDstring) on OutgoingTxBatch (ABI packing + keccak hashing, panics on errors); registered EthereumSigned implementations in codec; added protobuf interface annotations (implements_interface / accepts_interface) across peggy messages. Inspect panic paths, ABI JSON dependency, and proto-interface implications.
Protobuf — EVM, Exchange, TX modules
proto/injective/evm/v1/tx.proto, proto/injective/exchange/v2/exchange.proto, proto/injective/txfees/v1beta1/tx.proto, proto/injective/wasmx/v1/tx.proto
Added/adjusted cosmos_proto annotations for EVM txs; introduced EnforcedRestrictionsContract message and expanded ExecutionType enum (several new variants); enabled gogoproto registration flags in txfees and wasmx protos. Review generated code changes from proto options and enum additions.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I nibble code and count each batch,
ABI bits and keccak hatch,
Old Band proposals put to bed,
Partial cancels now are fed,
I hop — version bumped — and grin with a twitch.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[CHORE] Update Injective Core to v1.18.0-beta2' clearly summarizes the primary change—updating a core dependency to a specific beta version. It directly matches the file changes, particularly the Makefile update and the comprehensive proto/code updates that accompany this core version bump.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update_injective_core_v1_18_0_beta2

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the SDK’s synced Injective Core types/protos to v1.18.0-beta2, adding new proto annotations and updating Go module replacements to match the upstream release.

Changes:

  • Added gogoproto/cosmos-proto registration + interface annotations across multiple protos (wasmx, txfees, peggy, evm, oracle, exchange).
  • Introduced/updated generated Go types + registrations to align with updated proto options.
  • Updated dependency replacements (cometbft, block-sdk) and refreshed copied chain types (including new peggy batch logic).

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
proto/injective/wasmx/v1/tx.proto Enables gogoproto registration for wasmx messages.
proto/injective/txfees/v1beta1/tx.proto Enables gogoproto registration for txfees messages.
proto/injective/peggy/v1/types.proto Adds cosmos-proto interface implementation annotation for Valset.
proto/injective/peggy/v1/msgs.proto Adds interface annotations for claims + accepts_interface constraint for Any.
proto/injective/peggy/v1/batch.proto Adds cosmos-proto interface implementation annotation for OutgoingTxBatch.
proto/injective/peggy/v1/attestation.proto Constrains Any claim with accepts_interface.
proto/injective/oracle/v1beta1/proposal.proto Restores deprecated Band proposal messages for historical decode compatibility.
proto/injective/exchange/v2/exchange.proto Adds EnforcedRestrictionsContract message + updates Params field type.
proto/injective/evm/v1/tx.proto Adds accepts/implements interface annotations for TxData Any variants.
go.mod Updates replace versions and removes bandchain-packet requirement.
chain/wasmx/types/tx.pb.go Registers types/files with golang/protobuf (due to proto registration option).
chain/txfees/types/tx.pb.go Registers types/files with golang/protobuf (due to proto registration option).
chain/peggy/types/types.pb.go Adds cosmos-proto import (generated) for interface annotations.
chain/peggy/types/msgs.pb.go Updates generated descriptor (interface annotations).
chain/peggy/types/codec.go Registers new EthereumSigned interface + implementations in registry.
chain/peggy/types/batch.pb.go Adds cosmos-proto import (generated) for interface annotations.
chain/peggy/types/batch.go Adds OutgoingTxBatch checkpoint hashing implementation (copied from core).
chain/peggy/types/attestation.pb.go Adds cosmos-proto import (generated) for accepts_interface annotations.
chain/oracle/types/proposal.go Adds deprecated Band proposal Go implementations returning ErrBandOracleDeprecated.
chain/oracle/types/errors.go Adds ErrBandOracleDeprecated error.
chain/oracle/types/codec.go Registers deprecated Band proposal types (Amino + interface registry).
chain/exchange/types/v2/params.go Switches param validation to new enforced restrictions contract type.
chain/exchange/types/v2/derivative.go Adds PartialCancelOrders tracking + setters for cancel slices.
chain/exchange/types/v2/common_utils.go Import grouping/order adjustment.
chain/exchange/types/expected_keepers.go Adds PermissionsKeeper expected keeper interface.
chain/evm/types/tx.pb.go Updates generated descriptor (interface annotations).
Makefile Updates cloned core version + copies new peggy batch.go into SDK.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread chain/peggy/types/batch.go
// this should never happen outside of test since any case that could crash on encoding
// should be filtered above.
if err != nil {
panic(fmt.Sprintf("Error packing checkpoint! %s/n", err))
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The panic message uses "%s/n" which will literally render /n instead of a newline, and %s is not ideal for an error value. Use \n and format the error with %v (or call err.Error() explicitly) so the message is readable.

Suggested change
panic(fmt.Sprintf("Error packing checkpoint! %s/n", err))
panic(fmt.Sprintf("Error packing checkpoint! %v\n", err))

Copilot uses AI. Check for mistakes.
)

// GetCheckpoint gets the checkpoint signature from the given outgoing tx batch
func (b OutgoingTxBatch) GetCheckpoint(peggyIDstring string) common.Hash {
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

GetCheckpoint panics on parse/validation failures, which can crash callers in non-test paths. Prefer returning (common.Hash, error) (or providing a safe wrapper vs a MustGetCheckpoint), and move invariant panics (like a bad ABI constant) to package init-time so runtime execution can surface errors without halting.

Copilot uses AI. Check for mistakes.

abi, err := accountsabi.JSON(strings.NewReader(OutgoingBatchTxCheckpointABIJSON))
if err != nil {
panic("Bad ABI constant!")
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

GetCheckpoint panics on parse/validation failures, which can crash callers in non-test paths. Prefer returning (common.Hash, error) (or providing a safe wrapper vs a MustGetCheckpoint), and move invariant panics (like a bad ABI constant) to package init-time so runtime execution can surface errors without halting.

Copilot uses AI. Check for mistakes.
// will panic if peggyId is too long to fit in 32 bytes
peggyID, err := strToFixByteArray(peggyIDstring)
if err != nil {
panic(err)
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

GetCheckpoint panics on parse/validation failures, which can crash callers in non-test paths. Prefer returning (common.Hash, error) (or providing a safe wrapper vs a MustGetCheckpoint), and move invariant panics (like a bad ABI constant) to package init-time so runtime execution can surface errors without halting.

Copilot uses AI. Check for mistakes.
)

// GetCheckpoint gets the checkpoint signature from the given outgoing tx batch
func (b OutgoingTxBatch) GetCheckpoint(peggyIDstring string) common.Hash {
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The parameter name peggyIDstring is non-idiomatic and a bit unclear. Consider renaming to peggyID (or peggyIDStr) to match Go naming conventions and improve readability.

Copilot uses AI. Check for mistakes.
message MsgDepositClaim {
option (amino.name) = "peggy/MsgDepositClaim";
option (cosmos.msg.v1.signer) = "orchestrator";
option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim";
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

These interface names are not fully-qualified in the same way as other new annotations in this PR (e.g., injective.peggy.v1.EthereumSigned, cosmos.gov.v1beta1.Content). If the interface is actually declared under an injective.* proto package, this string mismatch will prevent interface resolution/Any unpacking at runtime. Align the interface name string with the exact proto package where EthereumClaim is defined.

Suggested change
option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim";
option (cosmos_proto.implements_interface) = "injective.peggy.v1.EthereumClaim";

Copilot uses AI. Check for mistakes.
message MsgWithdrawClaim {
option (amino.name) = "peggy/MsgWithdrawClaim";
option (cosmos.msg.v1.signer) = "orchestrator";
option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim";
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

These interface names are not fully-qualified in the same way as other new annotations in this PR (e.g., injective.peggy.v1.EthereumSigned, cosmos.gov.v1beta1.Content). If the interface is actually declared under an injective.* proto package, this string mismatch will prevent interface resolution/Any unpacking at runtime. Align the interface name string with the exact proto package where EthereumClaim is defined.

Copilot uses AI. Check for mistakes.
message MsgERC20DeployedClaim {
option (amino.name) = "peggy/MsgERC20DeployedClaim";
option (cosmos.msg.v1.signer) = "orchestrator";
option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim";
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

These interface names are not fully-qualified in the same way as other new annotations in this PR (e.g., injective.peggy.v1.EthereumSigned, cosmos.gov.v1beta1.Content). If the interface is actually declared under an injective.* proto package, this string mismatch will prevent interface resolution/Any unpacking at runtime. Align the interface name string with the exact proto package where EthereumClaim is defined.

Copilot uses AI. Check for mistakes.
Comment thread proto/injective/peggy/v1/msgs.proto
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@chain/peggy/types/batch.go`:
- Around line 59-63: Fix the typo in the panic message inside the error handling
for packing checkpoints by replacing the incorrect "/n" with the proper newline
escape "\n" in the fmt.Sprintf call (the expression panic(fmt.Sprintf("Error
packing checkpoint! %s/n", err))). Ensure the updated string uses "\\n" so the
panic message prints a newline after the error details.

Comment on lines +59 to +63
// this should never happen outside of test since any case that could crash on encoding
// should be filtered above.
if err != nil {
panic(fmt.Sprintf("Error packing checkpoint! %s/n", err))
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor typo in error message.

Line 62 has /n instead of \n for the newline escape sequence.

Proposed fix
-		panic(fmt.Sprintf("Error packing checkpoint! %s/n", err))
+		panic(fmt.Sprintf("Error packing checkpoint! %s\n", err))
📝 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
// this should never happen outside of test since any case that could crash on encoding
// should be filtered above.
if err != nil {
panic(fmt.Sprintf("Error packing checkpoint! %s/n", err))
}
// this should never happen outside of test since any case that could crash on encoding
// should be filtered above.
if err != nil {
panic(fmt.Sprintf("Error packing checkpoint! %s\n", err))
}
🤖 Prompt for AI Agents
In `@chain/peggy/types/batch.go` around lines 59 - 63, Fix the typo in the panic
message inside the error handling for packing checkpoints by replacing the
incorrect "/n" with the proper newline escape "\n" in the fmt.Sprintf call (the
expression panic(fmt.Sprintf("Error packing checkpoint! %s/n", err))). Ensure
the updated string uses "\\n" so the panic message prints a newline after the
error details.

@aarmoa aarmoa merged commit 7ebd018 into dev Feb 8, 2026
5 of 6 checks passed
@aarmoa aarmoa deleted the chore/update_injective_core_v1_18_0_beta2 branch February 8, 2026 02:53
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