Skip to content

fix: work around Lotus eth_call rejection for multisig accounts#419

Merged
rvagg merged 4 commits intomainfrom
rvagg/session-keys
Apr 1, 2026
Merged

fix: work around Lotus eth_call rejection for multisig accounts#419
rvagg merged 4 commits intomainfrom
rvagg/session-keys

Conversation

@rvagg
Copy link
Copy Markdown
Contributor

@rvagg rvagg commented Apr 1, 2026

Extract Synapse instance creation to common/synapse-factory.ts. In session key mode, use a custom transport that strips from on eth_call/eth_estimateGas so Lotus accepts reads when the payer is a contract address (Safe multisig). The client reports the multisig as account.address for SDK payer lookups while writes go through the session key client. See lotus#13470.

Extract Synapse instance creation to common/synapse-factory.ts. In
session key mode, use a custom transport that strips `from` on
eth_call/eth_estimateGas so Lotus accepts reads when the payer is a
contract address (Safe multisig). The client reports the multisig as
account.address for SDK payer lookups while writes go through the
session key client. See lotus#13470.
Copilot AI review requested due to automatic review settings April 1, 2026 07:09
@FilOzzy FilOzzy added this to FOC Apr 1, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes Synapse client construction and introduces a Lotus compatibility workaround for session-key + multisig (contract) payer setups, so read-only RPC calls are accepted while keeping the multisig as the payer identity.

Changes:

  • Added createSynapseFromConfig() factory to unify Synapse initialization (direct-key vs session-key).
  • Updated DealService and WalletSdkService to use the shared Synapse factory.
  • Updated the session key runbook with an extra operational step and clarified Safe batch output formatting.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
docs/runbooks/wallet-and-session-keys.md Adds a new operational step related to Lotus eth_call behavior and tweaks Safe batch list formatting.
apps/backend/src/wallet-sdk/wallet-sdk.service.ts Replaces inline Synapse setup with shared factory initialization and updates initialization logging.
apps/backend/src/deal/deal.service.ts Replaces inline Synapse setup with shared factory initialization and session-key-mode logging.
apps/backend/src/common/synapse-factory.ts New shared factory implementing session-key mode transport workaround and direct-key fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/backend/src/wallet-sdk/wallet-sdk.service.ts Outdated
Comment thread apps/backend/src/common/synapse-factory.ts
Comment thread apps/backend/src/common/synapse-factory.ts
Comment thread docs/runbooks/wallet-and-session-keys.md Outdated
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Apr 1, 2026
@rjan90 rjan90 added this to the M4.2: mainnet GA milestone Apr 1, 2026
@rjan90 rjan90 self-requested a review April 1, 2026 07:16
Comment thread apps/backend/src/common/synapse-factory.ts
@rvagg rvagg requested a review from rjan90 April 1, 2026 07:34
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Apr 1, 2026
@rvagg rvagg merged commit a66fb76 into main Apr 1, 2026
7 checks passed
@rvagg rvagg deleted the rvagg/session-keys branch April 1, 2026 07:43
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants