Skip to content

Conversation

@St0rmBr3w
Copy link
Contributor

Summary

  • Add devtools-sui package with Sui signer and connection factory
  • Add protocol-devtools-sui package with EndpointV2 SDK for Sui
  • Add ua-devtools-sui package with OFT SDK for Sui
  • Add devtools-starknet package with Starknet connection factory
  • Add protocol-devtools-starknet package with EndpointV2 SDK for Starknet
  • Add ua-devtools-starknet package with OFT SDK for Starknet
  • Update packages/devtools/src/common/bytes.ts to support SUI and STARKNET chain types in denormalizePeer

Test plan

  • CI passes (build, lint, compile)
  • Unit tests pass for new packages

Note: Example usage in oft-main will be added in a follow-up PR after these packages are published.

🤖 Generated with Claude Code

- Add SuiSigner for transaction signing with sender context
- Add createConnectionFactory and createRpcUrlFactory for RPC connections
- Add OmniSDK base class with transaction serialization
- Add Sui chain type to normalizePeer/denormalizePeer in devtools

Key design decisions:
- Transaction.serialize() used instead of build() to defer sender context
- Signer reconstructs transaction and sets sender during signing
- Connection factory reads from RPC_URL_SUI environment variable
- Add EndpointV2 SDK implementing IEndpointV2 interface
- Add Uln302 SDK for ULN configuration management
- Fix setConfig to call populateSetConfigTransaction (Move result consumption)
- Add graceful handling of missing configurations

Key fixes for lz:oapp:wire:
- setConfigMoveCall returns Call<Param, Result> that must be consumed
- populateSetConfigTransaction() adds necessary follow-up move call
- Missing config queries return defaults instead of throwing
- Add OFT SDK implementing IOApp interface
- Fix setPeer to pad EVM addresses (20 bytes) to 32 bytes
- Fix hasPeer to use areBytes32Equal for normalized comparison
- Add isMissingSuiPeer helper for graceful error handling

Key fixes for lz:oapp:wire:
- EVM addresses must be right-padded with zeros to 32 bytes for Sui
- Address comparison must normalize both addresses before comparing
- Missing peer/enforced_options errors return defaults instead of throwing
- Add @layerzerolabs/devtools-starknet for Starknet signer/provider
- Add @layerzerolabs/ua-devtools-starknet for Starknet OFT SDK
- Add @layerzerolabs/protocol-devtools-starknet for EndpointV2/ULN302 SDKs
- Fix address comparison in ua-devtools to use areBytes32Equal
- Fix library skip logic to prevent SAME_VALUE errors

Wire task now works correctly for Starknet OFTs with proper
address normalization and idempotent configuration detection.

Note: Send FROM Starknet has protocol-level bug in SendLib contract.
Send TO Starknet works correctly.
Key fixes:
- Fix fromHex to handle odd-length hex strings by padding with leading '0'
  (Buffer.from silently truncates odd-length strings)
- Fix ByteArray encoding in setEnforcedOptions to use raw calldata instead
  of string-based encoding (starknet.js UTF-8 re-encodes bytes >= 128)
- Update sendStarknet to use createRpcUrlFactory() for RPC URL resolution
- Update starknet.js v8 Account constructor format

These fixes resolve the "out of bound" error when sending from Starknet OFT
caused by corrupted enforced options (byte 0x80 becoming UTF-8 0xc2 0x80).
@cursor
Copy link

cursor bot commented Jan 27, 2026

PR Summary

Introduces first-class Sui and Starknet support across the repo with new SDKs and utilities.

  • New packages: devtools-sui, devtools-starknet (connection factories, address utils, Omni SDK base, signers); protocol-devtools-sui, protocol-devtools-starknet (EndpointV2 + ULN302 SDKs, config encoders, network addresses); ua-devtools-sui, ua-devtools-starknet (OFT SDKs, initial configurators/factories)
  • Serialization helpers for Sui/Starknet transactions and calldata; memoized connection factories with env-based RPC URL discovery
  • Adds chain address constants for EndpointV2/ULN302/Executor on mainnet/testnet
  • Core update: devtools/src/common/bytes.ts now supports SUI/STARKNET in normalize/denormalize peer and hardens fromHex (odd-length padding)
  • OApp config: avoid redundant library updates and SAME_VALUE errors by using areBytes32Equal and recognizing default libs

Written by Cursor Bugbot for commit 750457b. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

🧪 E2E Test Status

E2E tests are non-blocking and validate real blockchain interactions. Failures may occur due to network issues, RPC rate limits, or external service downtime.

Test Runs (Newest First):

  • Run #6648 - Failed - 2026-01-27 23:05 (UTC)
  • Run #6645 - Passed - 2026-01-27 19:41 (UTC)
  • Run #6643 - Passed - 2026-01-27 19:23 (UTC)
  • Run #6642 - Failed - 2026-01-27 19:13 (UTC)

@socket-security
Copy link

socket-security bot commented Jan 27, 2026

@socket-security
Copy link

socket-security bot commented Jan 27, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
Low adoption: npm @layerzerolabs/oft-mint-burn-starknet

Location: Package overview

From: packages/ua-devtools-starknet/package.jsonnpm/@layerzerolabs/oft-mint-burn-starknet@0.2.20

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/oft-mint-burn-starknet@0.2.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @layerzerolabs/protocol-starknet-v2

Location: Package overview

From: packages/devtools-starknet/package.jsonnpm/@layerzerolabs/protocol-starknet-v2@0.2.20

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/protocol-starknet-v2@0.2.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

hexValue = value
} else if (typeof value === 'bigint') {
hexValue = `0x${value.toString(16)}`
} else if (typeof value === 'object' && value !== null && 'value' in value) {
if (value instanceof Uint8Array || Buffer.isBuffer(value)) {
return `0x${Buffer.from(value).toString('hex')}`
}
if (typeof value === 'object' && value !== null && 'data' in value && 'pending_word' in value) {
if (typeof value === 'bigint') {
return `0x${value.toString(16)}`
}
if (typeof value === 'object' && value !== null && 'value' in value) {
- Add isNonEvmDeployment() to skip address checksumming for Sui/Starknet
- Update setPeer() in ua-devtools-sui to handle addresses ≤32 bytes (Starknet is 31 bytes)
…ngeset

- Remove CHANGELOG.md from new sui/starknet packages (will be auto-generated on publish)
- Add changeset for modified existing packages (devtools, metadata-tools, ua-devtools)
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