[CHORE] Update Injective Core to v1.18.0-beta2#345
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughUpdates 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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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.
| // 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)) |
There was a problem hiding this comment.
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.
| panic(fmt.Sprintf("Error packing checkpoint! %s/n", err)) | |
| panic(fmt.Sprintf("Error packing checkpoint! %v\n", err)) |
| ) | ||
|
|
||
| // GetCheckpoint gets the checkpoint signature from the given outgoing tx batch | ||
| func (b OutgoingTxBatch) GetCheckpoint(peggyIDstring string) common.Hash { |
There was a problem hiding this comment.
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.
|
|
||
| abi, err := accountsabi.JSON(strings.NewReader(OutgoingBatchTxCheckpointABIJSON)) | ||
| if err != nil { | ||
| panic("Bad ABI constant!") |
There was a problem hiding this comment.
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.
| // will panic if peggyId is too long to fit in 32 bytes | ||
| peggyID, err := strToFixByteArray(peggyIDstring) | ||
| if err != nil { | ||
| panic(err) |
There was a problem hiding this comment.
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.
| ) | ||
|
|
||
| // GetCheckpoint gets the checkpoint signature from the given outgoing tx batch | ||
| func (b OutgoingTxBatch) GetCheckpoint(peggyIDstring string) common.Hash { |
There was a problem hiding this comment.
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.
| message MsgDepositClaim { | ||
| option (amino.name) = "peggy/MsgDepositClaim"; | ||
| option (cosmos.msg.v1.signer) = "orchestrator"; | ||
| option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim"; |
There was a problem hiding this comment.
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.
| option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim"; | |
| option (cosmos_proto.implements_interface) = "injective.peggy.v1.EthereumClaim"; |
| message MsgWithdrawClaim { | ||
| option (amino.name) = "peggy/MsgWithdrawClaim"; | ||
| option (cosmos.msg.v1.signer) = "orchestrator"; | ||
| option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim"; |
There was a problem hiding this comment.
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.
| message MsgERC20DeployedClaim { | ||
| option (amino.name) = "peggy/MsgERC20DeployedClaim"; | ||
| option (cosmos.msg.v1.signer) = "orchestrator"; | ||
| option (cosmos_proto.implements_interface) = "peggy.v1beta1.EthereumClaim"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| // 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)) | ||
| } |
There was a problem hiding this comment.
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.
| // 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.
Update Injective Core to v1.18.0-beta2
Summary by CodeRabbit
New Features
Deprecations
Chores