Skip to content

fix(scripts): record the hex chain id in world.json - #348

Open
0xxlegolas wants to merge 1 commit into
mainfrom
fix/chain-id-format
Open

0xxlegolas wants to merge 1 commit into
mainfrom
fix/chain-id-format

Conversation

@0xxlegolas

Copy link
Copy Markdown
Collaborator

Summary

Newer Sui CLIs print two labelled lines for sui client chain-identifier:

Base58: 69WiPg3DAQiwdxfncX6wYQ2siKwAe6L9BZthQea3JNMD
Hex: 4c78adac

deploy-world.sh and deploy-currency.sh stored the whole output as chainId in world.json, and the SDK (getWorldConfig) passes that value on as-is. Copilot flagged this on #347, where the value was fixed by hand.

Changes

  • scripts/lib.sh: new chain_id helper. It keeps the Hex: value, falls back to the bare output on older CLIs, and fails unless the result is 8 hex characters.
  • deploy-world.sh, deploy-currency.sh: use chain_id.
  • ts-scripts/build-manifest.ts: rejects a chainId that is not 8 hex characters.
  • deployments/dev/world.json: corrects the bad value already on main to 4c78adac. Test's value is fixed in deploy(test): 1.1.20 #347.

Note

Deploys run the scripts baked into the tagged image, so records PRs from 1.1.20 or 1.1.21 will still carry the bad value. The fix applies to deploys from the first release cut after this merges.

Testing

  • chain_id against Sui CLI 1.78 (two-line output), a stubbed bare-hex output, and invalid output, which fails.
  • build-manifest.ts rejects the two-line value.
  • biome check, and the SDK unit tests pass.

🤖 Generated with Claude Code

Newer Sui CLIs print "Base58: …" and "Hex: …" lines for
`sui client chain-identifier`, and the deploy scripts stored the whole
output as chainId. Parse the hex value in a shared chain_id helper,
reject anything that is not 8 hex characters in build-manifest.ts, and
fix the bad value already recorded for dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xxlegolas
0xxlegolas requested a review from a team as a code owner December 1, 2026 15:08
@0xxlegolas
0xxlegolas requested a balanced review from Copilot December 1, 2026 16:31

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues are reported for the chain identifier handling changes.

No open issues 🎉

What changed in this PR

Ensures deployment manifests store the hexadecimal chain identifier expected by the SDK, rather than the labelled output from newer Sui CLIs.

Changes:

  • Adds a shared helper that handles both CLI output formats and validates the identifier.
  • Updates both deployment scripts to use the helper and adds validation in the manifest builder.
  • Corrects the existing development manifest’s chain identifier.
File Description
ts-scripts/​build-manifest.ts Rejects chain identifiers that are not eight lowercase hex characters.
scripts/​lib.sh Adds chain identifier extraction and validation.
scripts/​deploy-world.sh Uses the shared helper when building the world manifest.
scripts/​deploy-currency.sh Uses the shared helper when building the currency manifest.
deployments/​dev/​world.json Corrects chainId to 4c78adac.

Review effort: Balanced

This branch has not been deployed

No deployments
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