Skip to content

build: NONEVM-4285: implement stellar encoder#730

Merged
FelixFan1992 merged 6 commits intomainfrom
stellar-encoder
May 6, 2026
Merged

build: NONEVM-4285: implement stellar encoder#730
FelixFan1992 merged 6 commits intomainfrom
stellar-encoder

Conversation

@FelixFan1992
Copy link
Copy Markdown
Contributor

@FelixFan1992 FelixFan1992 commented May 5, 2026

  1. implement encoder for Stellar
  2. set up dependabot
  3. Stellar MCMS currently uses ABI encoding for merkle roots. the full implementation is here

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: 7f05103

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smartcontractkit/mcms Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@FelixFan1992 FelixFan1992 marked this pull request as ready for review May 5, 2026 15:24
@FelixFan1992 FelixFan1992 requested a review from a team as a code owner May 5, 2026 15:24
Comment thread sdk/stellar/chain.go Outdated
Comment thread sdk/stellar/address.go Outdated
Comment thread sdk/stellar/address.go Outdated
Comment thread sdk/stellar/address.go Outdated
Comment thread sdk/stellar/chain.go Outdated
Comment thread sdk/stellar/encoder.go
}

s := *af.Value
if len(s) >= hexPrefixLen && (s[0:hexPrefixLen] == "0x" || s[0:hexPrefixLen] == "0X") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

another nit: if you use n.SetString(*af.Value, 0) it auto-detects the 0x prefix and interprets it as hex.

Comment thread sdk/stellar/encoder.go Outdated
gustavogama-cll
gustavogama-cll previously approved these changes May 5, 2026
Copy link
Copy Markdown
Contributor

@gustavogama-cll gustavogama-cll left a comment

Choose a reason for hiding this comment

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

Added a few minor suggestions about small optimizations which can be safely ignored. The only real requests I have is (1) to review the functions that are initially exported (remember we can always change from private to public afterwards); (2) improve the test coverage, for this type of code I think we should aim for >80%.

Copilot AI review requested due to automatic review settings May 6, 2026 07:57
Copy link
Copy Markdown
Contributor

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

This PR introduces Stellar (Soroban MCMS) ABI-compatible hashing/encoding support in the Go SDK and updates dependency management to track the new Stellar SDK dependency.

Changes:

  • Add Stellar as a supported chain family in chain selector handling.
  • Introduce a new sdk/stellar package implementing sdk.Encoder plus ABI preimage construction and golden-vector tests.
  • Update go.mod/go.sum, Dependabot allowlist, and add a changeset for publishing.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
types/chain_selector.go Adds chainsel.FamilyStellar to the list of supported families.
sdk/stellar/encoder.go Implements sdk.Encoder for Stellar and parses optional additionalFields.value.
sdk/stellar/encode.go Implements Stellar-specific ABI word packing and Keccak hashing for metadata/ops.
sdk/stellar/constants.go Defines ABI/layout constants and domain separators.
sdk/stellar/address.go Parses Stellar contract identifiers from strkey or 32-byte hex.
sdk/stellar/chain.go Maps chain selector → Stellar network ID via chain-selectors.
sdk/stellar/encoder_test.go Tests encoder output consistency and contract-id parsing.
sdk/stellar/encode_test.go Tests domain constants and hashing against golden vectors / ABI encoder.
go.mod Adds github.com/stellar/go-stellar-sdk (and indirect go-xdr).
go.sum Updates dependency checksums (incl. Stellar deps, go-errors bump).
.github/dependabot.yml Allowlists github.com/stellar/go-stellar-sdk for gomod updates.
.changeset/free-peaches-itch.md Declares a patch release for Stellar encoder support.

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

Comment thread types/chain_selector.go
Comment thread sdk/stellar/encoder.go
Comment thread sdk/stellar/encoder.go
@FelixFan1992 FelixFan1992 changed the title NONEVM-4285: implement stellar encoder build: NONEVM-4285: implement stellar encoder May 6, 2026
@cl-sonarqube-production
Copy link
Copy Markdown

@FelixFan1992 FelixFan1992 enabled auto-merge (squash) May 6, 2026 21:28
@FelixFan1992 FelixFan1992 merged commit 888e436 into main May 6, 2026
20 checks passed
@FelixFan1992 FelixFan1992 deleted the stellar-encoder branch May 6, 2026 23:15
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.

4 participants