fix: work around Lotus eth_call rejection for multisig accounts#419
Merged
fix: work around Lotus eth_call rejection for multisig accounts#419
Conversation
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.
Contributor
There was a problem hiding this comment.
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
DealServiceandWalletSdkServiceto 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.
rjan90
reviewed
Apr 1, 2026
rjan90
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract Synapse instance creation to common/synapse-factory.ts. In session key mode, use a custom transport that strips
fromon 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.