docs: add S-16 API chainId sync plan (blocks testudo-api deploy)#4
Merged
docs: add S-16 API chainId sync plan (blocks testudo-api deploy)#4
Conversation
…ploy) Captures the client-side work needed to match testudo-api PR #5, which moves threat/safe/encounter routes under /api/v1/chains/:chainId/... Default to mainnet (chainId=1) when chainId is not yet resolved from eth_chainId, so pingApi and first-paint analysis don't block on RPC. Prerequisite for the larger 2.1 Multichain EVM Support work. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds a new In Progress item to the roadmap: API chainId Sync (S-16 Client Update). This is the extension-side work required to match testudo-api PR #5 which moves client-facing routes under
/api/v1/chains/:chainId/....Deploying the API without shipping this update first would 404 every threat lookup in the field.
Context
testudo-api PR #5 (S-16 Consistent chainId Modeling) changes three extension-facing endpoints:
GET /api/v1/threats/address/:addressGET /api/v1/chains/:chainId/threats/address/:addressGET /api/v1/safe/address/:addressGET /api/v1/chains/:chainId/safe/address/:addressPOST /api/v1/encounters(chainId in body)POST /api/v1/chains/:chainId/encounters(chainId in path)The domain threat route stays global, so
checkDomainThreat()is unaffected.What this PR does
Documentation only — captures the plan, priority, scope, and design decision (mainnet default). No code changes.
Key design decision: when
chainIdisn't yet resolved frometh_chainId(cold-startpingApi, first-paint analysis before RPC responds), default to1(mainnet) rather than failing the request. Rationale documented in the roadmap entry.Affected call sites (extension)
packages/extension/src/api-client.ts—checkAddressThreat(),pingApi()packages/extension/src/analysis.ts— threadchainIdthroughAnalysisDepspackages/extension/src/background.ts— extractchainIdviaeth_chainIdwith mainnet fallbackpackages/extension/src/injected.tsx— propagate chainId already extracted from EIP-7702 TypedDatapackages/extension/tests/api-client.test.ts+tests/analysis.test.ts— ~53 test cases to updateShip sequence
Relationship to existing roadmap
This is a hard prerequisite for
2.1 Multichain EVM Support— same chainId plumbing, narrower scope (API calls only, not RPC routing or Blockscout). 2.1 builds on top of this.Test plan
🤖 Generated with Claude Code