Skip to content

Comments

fix: harden 0.4.0 migration for latest Sui/Seal and CI#61

Closed
arbuthnot-eth wants to merge 5 commits intoMystenLabs:mainfrom
arbuthnot-eth:fix/sui-seal-0-4-0-ci-node22
Closed

fix: harden 0.4.0 migration for latest Sui/Seal and CI#61
arbuthnot-eth wants to merge 5 commits intoMystenLabs:mainfrom
arbuthnot-eth:fix/sui-seal-0-4-0-ci-node22

Conversation

@arbuthnot-eth
Copy link

Summary

This PR hardens the 0.4.0 migration for latest Sui/Seal by addressing runtime and API-compatibility gaps discovered during validation.

Fixes #60

Changes

  • Update GitHub Actions workflows to Node 22 (required by @mysten/sui@2.4.0):
    • .github/workflows/ci.yml
    • .github/workflows/npm-publish.yml
  • Add integration coverage to CI localnet flow:
    • run TEST_ENVIRONMENT=localnet pnpm run test:integration
  • Add pre-publish unit-test gate in npm publish workflow.
  • Align script helper with current Sui client typing/API:
    • scripts/utils.ts
    • use ClientWithCoreApi and client.core.signAndExecuteTransaction(...)
    • use client.core.waitForTransaction(...)
  • Enforce engine floor in package metadata:
    • packages/messaging/package.json -> "node": ">=22"

Why

  • Prevent CI/publish breakage from Node 20 vs Sui SDK Node >=22 requirement.
  • Ensure local scripts compile and execute against current @mysten/sui client APIs.
  • Increase confidence by running unit + integration paths in CI.

Validation

  • pnpm -C packages/messaging build
  • pnpm -C packages/messaging lint
  • pnpm -C packages/messaging test:unit
  • pnpm -C scripts exec tsc -p tsconfig.json --noEmit

Note: integration tests require a Docker-capable runtime (testcontainers).

Integrate @mysten/suins to enable human-readable name resolution in the
messaging SDK. Users can now use SuiNS names (e.g., "alice.sui") instead
of raw addresses when creating channels or adding members.

- Add @mysten/suins dependency
- Create AddressResolver interface and SuiNSResolver implementation
- Add optional addressResolver to client options
- Resolve names in createChannelFlow() and addMembers()
- Export SuiNSResolver, isSuiNSName, and AddressResolver type
Add comprehensive unit tests for the address resolution utilities:
- isSuiNSName() detection function
- SuiNSResolver.resolve() single name resolution
- SuiNSResolver.resolveMany() batch resolution
- Mixed arrays (names + addresses)
- Error handling for unresolvable names
- Custom AddressResolver implementation example

21 tests covering all edge cases.
Add human-readable channel name support to the messaging SDK. Users can
now reference channels by name (e.g., "#general") instead of raw object IDs.

## New Features

- `ChannelNameResolver` interface for pluggable name resolution
- `LocalChannelRegistry` for in-memory channel name mapping
- `PersistentChannelRegistry` for browser localStorage persistence
- Helper functions: `isChannelName()`, `normalizeChannelName()`, `formatChannelName()`

## SDK Integration

- Added optional `channelResolver` to client options
- Updated methods to accept channel names:
  - `getChannelMembers()`
  - `getChannelMessages()`
  - `getLatestMessages()`
  - `executeSendMessageTransaction()`
  - `executeAddMembersTransaction()`
  - `addMembers()`

## Usage

```typescript
import { messaging, LocalChannelRegistry } from '@mysten/messaging';

const channelRegistry = new LocalChannelRegistry();
await channelRegistry.register('general', '0xchannel123...');

const client = suiClient.$extend(messaging({
  channelResolver: channelRegistry,
  // ... other options
}));

// Use channel names directly
const members = await client.messaging.getChannelMembers('#general');
```

## Tests

- 40 unit tests for channel resolution utilities
- All 61 unit tests passing
@arbuthnot-eth arbuthnot-eth force-pushed the fix/sui-seal-0-4-0-ci-node22 branch from e0ba226 to c09debf Compare February 16, 2026 06:01
@arbuthnot-eth
Copy link
Author

Closing to reopen from a fresh branch with explicit clean 2-commit history.

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.

Harden 0.4.0 migration: Node 22 CI + Sui client script compatibility

1 participant