Skip to content

fix: complete 0.100.21 mainnet deploy (witness, deploy script, frontend build, gateway routing) - #8

Merged
Yiakman merged 1 commit into
v2from
fix/0.100.21-mainnet-deploy-fixes
Jun 12, 2026
Merged

Yiakman merged 1 commit into
v2from
fix/0.100.21-mainnet-deploy-fixes

Conversation

@Yiakman

@Yiakman Yiakman commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Follow-up fixes discovered while deploying the effectstream 0.100.21 + bun migration (PR #7) to the mainnet box. Each is required for go-fish to actually run on the new contract. The mainnet redeploy + cutover are already live on the box; this PR makes the source match.

Changes

1. wit_split_card_index witness (the blocker)

packages/client/node/src/midnight-actions.ts — the compiled Midnight contract requires a wit_split_card_index witness, but actionWitnesses never defined it. Result: initializeActionContract throws and the node crash-loops once sync reaches live game-action events. (Dormant before because the node was ~17 days behind; the mainnet skip-ahead brought it to realtime and exposed it. Pre-dates this migration — traces to the admin_secret_key stub work.)

Fix mirrors the frontend midnightBridge witness, validated against the contract's own reconstruction check: index = suit*7 + rank, returned as bigints ([Uint<0..256>, Uint<0..256>]).

2. deploy.mainnet.ts broken import

packages/shared/contracts/evm/deploy.mainnet.ts still imported the deleted GoFishLobby module and referenced result.paimaL2Contract. Repointed to effectstreaml2-module on the arbitrum network so the mainnet deploy runs.

3. New mainnet contract address

deployed_addresses.json (key was the stale GoFishModule#PaimaL2Contract) and frontend VITE_PAIMA_L2_CONTRACT_ADDRESS now record the redeployed contract:
0x148bC957bFbCd344A50ec9cC08654c6e2A9656c2 (Arbitrum, deploy block 472739253).

4. Frontend mainnet build fix

frontend/vite.config.ts — add nodePolyfills({ overrides: { fs: "memfs", "node:fs": "memfs" } }). Without it build:mainnet fails: server-only get-wallet-info (pulled in via @effectstream/wallets) hits node-stdlib-browser's empty fs mock and can't resolve named exports. Matches block-kart.

5. Gateway read routing

config.mainnet.ts — route EVM reads through ARBITRUM_ONE_RPC (the local evm-gateway cache) instead of arbitrum's default public RPC, matching the other migrated games. (Not in the original ask, but it's live on the box and origin/v2 would otherwise bypass the gateway — drop this commit hunk if you'd rather keep it box-local.)

Notes

  • Generated artifacts (build/, midnight managed/) are gitignored and unchanged.
  • ⚠️ Operational: the box is 16 GB RAM with no swap; starting go-fish on bun OOM-cascaded the whole instance once. go-fish's systemd units now carry MemoryMax/MemoryHigh caps (box-side, not in this repo).

🤖 Generated with Claude Code

…nd build, gateway routing)

Follow-up fixes found while deploying the effectstream 0.100.21 + bun migration
to mainnet. Each is required for go-fish to actually run on the new contract.

- node: add missing `wit_split_card_index` witness to actionWitnesses. The
  compiled contract requires it; without it `initializeActionContract` throws
  and the node crash-loops once sync reaches live game-action events. Mirrors
  the frontend midnightBridge witness (index = suit*7 + rank, returned as
  bigints).

- evm: fix deploy.mainnet.ts — it still imported the deleted GoFishLobby module
  and referenced result.paimaL2Contract. Point it at effectstreaml2-module on
  the arbitrum network so the mainnet deploy works.

- deployed_addresses.json + frontend VITE_PAIMA_L2_CONTRACT_ADDRESS: record the
  redeployed mainnet effectstreaml2 contract 0x148bC957bFbCd344A50ec9cC08654c6e2A9656c2.

- frontend/vite.config.ts: nodePolyfills `overrides: { fs: memfs, 'node:fs': memfs }`
  so server-only modules pulled into the bundle (get-wallet-info via
  @effectstream/wallets) resolve named fs exports instead of the empty mock.
  Matches block-kart. Without it `build:mainnet` fails.

- config.mainnet.ts: route EVM reads through ARBITRUM_ONE_RPC (the local
  evm-gateway cache) instead of arbitrum's default public RPC, matching the
  other migrated games.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Yiakman
Yiakman merged commit ca9ef52 into v2 Jun 12, 2026
@Yiakman
Yiakman deleted the fix/0.100.21-mainnet-deploy-fixes branch June 12, 2026 22:21
Yiakman added a commit that referenced this pull request Jun 13, 2026
fix: add wit_split_card_index to queryWitnesses (follow-up to #8)
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