Skip to content

chore: KEEP-230 remove Para SDK and supporting code#1148

Merged
joelorzet merged 13 commits into
stagingfrom
chore/KEEP-230-decom-para
May 28, 2026
Merged

chore: KEEP-230 remove Para SDK and supporting code#1148
joelorzet merged 13 commits into
stagingfrom
chore/KEEP-230-decom-para

Conversation

@joelorzet
Copy link
Copy Markdown

Summary

Follow-up to PR #983 (Para signing decom). Removes the remaining Para surface area now that Turnkey is the sole wallet provider.

  • Drops @getpara/ethers-v6-integration and @getpara/server-sdk; deletes lib/para/, lib/encryption.ts (Para MPC user-share helpers), and the specs/web3/PARA_* docs.
  • Replaces the Para-backed viem LocalAccount used by the sponsored ERC-4337 client with a Turnkey-backed adapter (lib/web3/turnkey-viem-account.ts). Moves wallet helpers out of lib/para/ to lib/web3/wallet-helpers.ts and drops the deprecated user-id-keyed lookups.
  • Deletes Para-only API routes (/api/user/wallet/refresh-share, /api/user/wallet/share) and removes the provider = 'turnkey' filter from export-key/verify since the column is going away.
  • Migration 0069_keep_230_decom_para: deletes any non-Turnkey rows, drops provider, para_wallet_id, user_share, and renames para_wallets to organization_wallets (with FK + index renames).
  • Drops Para test infrastructure: tests/integration/eip7702-spike.{test.ts,d.ts}, the Para Portal API cleanup branch in tests/e2e/playwright/utils/cleanup.ts, and the seed-test-wallet / fund-test-wallet scripts. Switches transaction-flow + write-contract-workflow skip-conditions from PARA_* to TURNKEY_* env vars.
  • Strips PARA_* env vars from helm values (staging, prod, pr-environment), the e2e GitHub workflow, and the setup-e2e-db action.

Test plan

  • pnpm type-check passes
  • pnpm check introduces no new lint errors vs staging baseline
  • Docker image builds and the container starts cleanly
  • pnpm test:unit passes (in particular tests/unit/sponsored-client.test.ts after the Turnkey adapter swap)
  • pnpm test:integration passes (no Para-touching integration tests remain)
  • E2E happy-path against a fresh wallet (Turnkey-only): create wallet, run a transfer-funds workflow, verify on-chain
  • Migration 0069 runs cleanly against a staging snapshot — confirm organization_wallets table and surviving columns
  • Sponsored (gas-credit) transaction path still signs via the new Turnkey adapter when NEXT_PUBLIC_GAS_SPONSORSHIP_ENABLED=true

…ng code

Para signing was retired in PR #983; this follow-up removes the now-dead
surface area so Turnkey is the only wallet path.

- Drop @getpara/ethers-v6-integration and @getpara/server-sdk from
  package.json + pnpm-lock; delete lib/para/, lib/encryption.ts (Para
  MPC user-share helpers), and Para spec docs.
- Replace the Para-backed viem LocalAccount used by sponsored-client.ts
  with a Turnkey-backed adapter (lib/web3/turnkey-viem-account.ts) that
  signs through the Turnkey API client. Move org-scoped wallet helpers
  out of lib/para/ to lib/web3/wallet-helpers.ts and drop the deprecated
  user-id-keyed lookups.
- Delete Para-only API routes (refresh-share, share) and strip the
  provider="turnkey" filter from export-key/verify since provider is
  going away.
- Drop the Para columns (provider, para_wallet_id, user_share) and
  rename para_wallets -> organization_wallets via migration 0069.
  Update Drizzle schema, relations, and the prometheus / db-metrics
  collectors to drop the Para gauge and provider split.
- Remove Para test infrastructure: delete the eip7702-spike integration
  test, the Para portal cleanup logic in the Playwright e2e helpers,
  and the seed-test-wallet / fund-test-wallet scripts. Update
  transaction-flow + write-contract-workflow tests to skip on missing
  Turnkey env (instead of missing PARA_*).
- Strip PARA_* env vars from staging / prod / pr-environment helm
  values, the e2e GitHub workflow, and the setup-e2e-db action.
Renumbers KEEP-230 migration from 0069 to 0071 to land after staging's
0069_add_feedback_table and 0070_workflow_executions_billable. Restores
the Turnkey-rewritten seed-test-wallet script that staging maintains for
E2E (retargeted onto organization_wallets and stripped of the dropped
provider column) along with its db:seed-test-wallet npm script. Cleans
up remaining para_wallets references in agentic-wallet-workflow-binding
test mock, playwright cleanup util, and schema-extensions header.
Renumbers KEEP-230 migration from 0071 to 0072 to land after the new
0071_keep_470_workflow_tx_hash_array migration on staging.
Renumbers KEEP-230 migration from 0072 to 0077 to land after staging's
0072-0076 (workflows seeded_at, executions error classification, soft
delete, db indexes, wallet integration name backfill).

Fixes stale @/lib/para/wallet-helpers imports in
plugins/web3/steps/sign-typed-data-core.ts and two test mocks that were
added on staging after this branch deleted that path; retargets them to
@/lib/web3/wallet-helpers.

Keeps both halves of the package.json scripts conflict so staging's
db:seed-workflows + db:seed-all coexist with the restored
db:seed-test-wallet entry that db:seed-all depends on. Restores staging's
SYSTEM_ACTIONS/TEMPLATE_SYNTAX/TRIGGERS imports in
app/api/mcp/schemas/route.ts.
@joelorzet joelorzet requested review from a team, OleksandrUA, eskp and suisuss and removed request for a team May 18, 2026 22:35
@joelorzet joelorzet marked this pull request as ready for review May 18, 2026 22:35
@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

@github-actions
Copy link
Copy Markdown

🧹 PR Environment Cleaned Up

The PR environment has been successfully deleted.

Deleted Resources:

  • Namespace: pr-1148
  • All Helm releases (Keeperhub, Scheduler, Event services)
  • PostgreSQL Database (including data)
  • LocalStack, Redis
  • All associated secrets and configs

All resources have been cleaned up and will no longer incur costs.

Para has been fully removed; the comment claiming the Safe owner could
be a Turnkey or Para row was leftover from the dual-provider era.
@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

paraWallets schema mock and the provider field on the wallet fixture
are no longer read by anything; the schema export is gone and the
column is dropped by migration 0082.
@github-actions
Copy link
Copy Markdown

🧹 PR Environment Cleaned Up

The PR environment has been successfully deleted.

Deleted Resources:

  • Namespace: pr-1148
  • All Helm releases (Keeperhub, Scheduler, Event services)
  • PostgreSQL Database (including data)
  • LocalStack, Redis
  • All associated secrets and configs

All resources have been cleaned up and will no longer incur costs.

Postgres auto-rewires the FK target on RENAME TABLE but keeps the
constraint name. Renaming the constraint here avoids a future
drizzle-kit generate emitting a one-line rename migration of its own.
Idempotent via pg_constraint lookup so reruns are safe.
@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

@github-actions
Copy link
Copy Markdown

PR Environment Deployed

Your PR environment has been deployed!

Environment Details:

Components:

  • Keeperhub Application
  • PostgreSQL Database (isolated instance)
  • LocalStack (SQS emulation)
  • Redis (isolated instance)
  • Schedule Dispatcher (staging image)
  • Block Dispatcher (staging image)
  • Event Tracker (staging image)

The environment will be automatically cleaned up when this PR is closed or merged.

Also drop WALLET_ENCRYPTION_KEY everywhere it was forwarded: the only
consumer was the deleted lib/encryption.ts (Para MPC user-share helpers),
so the executor config field, the k8s-job env propagation, the
GitHub Actions composite (start-app/wallet_encryption_key input,
e2e-tests-ephemeral.yml forwarding) and the helm values for staging /
prod / pr-environment / executor / local-dev are all dead config now.

Resolve conflicts:
- app/api/user/wallet/export-key/request/route.ts -> accept staging's
  deletion (the endpoint was retired with the dual-factor MFA flow).
- app/api/user/wallet/export-key/verify/route.ts -> keep staging's
  TOTP-only verify flow; the email-OTP code that this branch was
  cleaning up is now gone entirely.
- app/api/user/wallet/withdraw/route.ts -> take staging's new
  requireOwnerWithMfa + helper imports, but point them at the new
  lib/web3/wallet-helpers path instead of the deleted lib/para path.
- keeperhub-executor/startup-checks.ts -> keep staging's ephemeral-env
  downgrade + query timeout, but drop the provider="turnkey" filter
  since the provider column is being removed by migration 0092.
- drizzle/meta/_journal.json -> renumber the Para decom migration from
  0082 to 0092 to land after all of staging's interleaved migrations,
  and rename drizzle/0082_keep_230_decom_para.sql accordingly.
- pnpm-lock.yaml -> take staging's lockfile and regenerate so the
  @getpara/* entries stay out and staging's additions are picked up.

Drop specs/integration-based-wallet-creation.md (entirely Para-flow
documentation, replaced by the Turnkey path) and update tests/README.md
to point at the Turnkey provisioning env vars instead of the Para
user-share / WALLET_ENCRYPTION_KEY pair.
@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

@github-actions
Copy link
Copy Markdown

⚠️ PR Environment Cleanup Issues

The PR environment cleanup encountered issues.

Namespace: pr-1148

Some resources may still exist. Please check the workflow logs for details.

You may need to manually clean up:

kubectl delete namespace pr-1148 --force --grace-period=0

@github-actions
Copy link
Copy Markdown

PR Environment Deployment Failed

The PR environment deployment encountered an error.

Please check the workflow logs for details.

Common issues:

  • Database initialization timeout
  • Image build failures
  • Resource constraints

@github-actions
Copy link
Copy Markdown

PR Environment Deployed

Your PR environment has been deployed!

Environment Details:

Components:

  • Keeperhub Application
  • PostgreSQL Database (isolated instance)
  • LocalStack (SQS emulation)
  • Redis (isolated instance)
  • Schedule Dispatcher (staging image)
  • Block Dispatcher (staging image)
  • Event Tracker (staging image)

The environment will be automatically cleaned up when this PR is closed or merged.

Hard-grep sweep across the repo after the staging merge for any
Para-flavoured strings the previous commits missed.

- Spec docs: delete the historical Para handover / migration docs
  (organizations_migration_handover, wallet-migration-todo,
  organization-wallet-execution) that documented the Para-era flow
  end-to-end; rewrite the surviving organization / wallet-overlay specs
  and the logging-and-metrics example to use Turnkey naming and
  /lib/web3/wallet-helpers paths.
- Executor helm charts (prod + staging + pr-environment): drop the
  PARA_API_KEY parameterStore entry and the PARA_ENVIRONMENT kv entry
  alongside the WALLET_ENCRYPTION_KEY removal.
- Local dev: strip the PARA_API_KEY / PARA_ENVIRONMENT /
  NEXT_PUBLIC_PARA_* kv stanzas from values-keeperhub.template.yaml
  and the matching sed substitutions + help text from deploy.sh.
- PR seed verifier: query organization_wallets instead of para_wallets.
- Tests: drop the paraWallets mock from safe-roles-orchestrator and the
  stray "ParaWallet" comment in lib/auth.ts permissions config.
@github-actions
Copy link
Copy Markdown

PR Environment Deployed

Your PR environment has been deployed!

Environment Details:

Components:

  • Keeperhub Application
  • PostgreSQL Database (isolated instance)
  • LocalStack (SQS emulation)
  • Redis (isolated instance)
  • Schedule Dispatcher (staging image)
  • Block Dispatcher (staging image)
  • Event Tracker (staging image)

The environment will be automatically cleaned up when this PR is closed or merged.

…aming

The org-scoped wallet model documented here is still load-bearing
architecture; only the signer backend changed Para -> Turnkey. The
previous sweep deleted the file along with the genuinely obsolete
handover / migration docs, which removed useful design context. Bring
it back and rename the Para references inline:

- initializeParaSigner -> initializeWalletSigner
- Para signer -> Turnkey signer
- ParaWallet / Para wallet -> Wallet
- para_wallets -> organization_wallets
- keeperhub/lib/para/wallet-helpers.ts -> lib/web3/wallet-helpers.ts
@github-actions
Copy link
Copy Markdown

PR Environment Deployed

Your PR environment has been deployed!

Environment Details:

Components:

  • Keeperhub Application
  • PostgreSQL Database (isolated instance)
  • LocalStack (SQS emulation)
  • Redis (isolated instance)
  • Schedule Dispatcher (staging image)
  • Block Dispatcher (staging image)
  • Event Tracker (staging image)

The environment will be automatically cleaned up when this PR is closed or merged.

@github-actions
Copy link
Copy Markdown

🧹 PR Environment Cleaned Up

The PR environment has been successfully deleted.

Deleted Resources:

  • Namespace: pr-1148
  • All Helm releases (Keeperhub, Scheduler, Event services)
  • PostgreSQL Database (including data)
  • LocalStack, Redis
  • All associated secrets and configs

All resources have been cleaned up and will no longer incur costs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-pr-environment deploy-pr-executor Build a PR-specific executor image alongside the PR env deploy (KEEP-556)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants