feat(scenarios): add Tessera state preparation - #11
Conversation
|
26dd7ea to
8539d42
Compare
|
No actionable findings in the reviewed diff. The previously reported RPC-target issue is fixed at Tests could not run because Rustup attempted to write outside the permitted workspace. |
8539d42 to
c6449f5
Compare
|
Tessera is a proprietary market maker with no IDL, so its market accounts are written through the raw byte layout the BisonFi work introduced. Eight templates cover price, depth, curve, halt, staleness and freshness. The market catalog lists all 26 live markets with their mints, decimals and freshness limit, so the UI constrains the choice and a model can resolve one through search_constant_options. One builder exists, for the only thing a template cannot express: turning a human price into the pair of reciprocal atomic ratios, which needs both mints' decimals.
c6449f5 to
d18d14f
Compare
|
No actionable issues found in the PR changes. Focused tests could not run because Rustup attempted to write under the read-only |
Replace the static market catalog with on-chain discovery and add exact depth preparation with live swap coverage. Accept decimal u64/i64 overrides through the IDL encoder for lossless Studio editing.
|
No concrete bugs found in the specified PR range. One testing improvement: add a local RPC test for Tests could not run: the pinned toolchain required a write outside the sandbox, and the installed toolchain’s offline dependency cache lacked |
| }; | ||
|
|
||
| let accounts = match self | ||
| .fetch_surfnet_accounts(params.surfnet_port, &[market_address]) |
There was a problem hiding this comment.
Scenario targets the wrong Surfnet
When surfnet_port selects a dynamically allocated Surfnet, the tool derives the scenario from that Surfnet but stages an editor URL with no Surfnet association. Playing it registers the scenario against Studio's main Surfnet, causing overrides calculated from one network's account state to be applied to another network.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/mcp/src/surfpool/mod.rs
Line: 1098
Comment:
**Scenario targets the wrong Surfnet**
When `surfnet_port` selects a dynamically allocated Surfnet, the tool derives the scenario from that Surfnet but stages an editor URL with no Surfnet association. Playing it registers the scenario against Studio's main Surfnet, causing overrides calculated from one network's account state to be applied to another network.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Stacked on #8 — Tessera is the same mechanism class as BisonFi (PMM, no IDL) and reuses the raw-layout engine it introduced.
create_tessera_fair_value_scenario, on the generic scenario path. No protocol HTTP endpoints.monitoring.yamlis documentation only: the program-upgrade fingerprint and the catalog refresh procedure.Greptile Summary
The PR adds Tessera market discovery and scenario preparation for fair-value and depth overrides, including raw layouts, freshness handling, MCP tools, and live tests. The dynamic Surfnet targeting fix remains incomplete because scenario playback is still associated with the main Studio Surfnet.
Confidence Score: 4/5
The PR is not yet safe to merge because scenarios derived from a dynamically selected Surfnet can be applied to the main/default Surfnet instead.
The account-read fix honors
surfnet_port, but staging and Studio playback retain no corresponding Surfnet identity, allowing a scenario derived from one network's state to modify another network.Files Needing Attention: crates/mcp/src/surfpool/mod.rs
Important Files Changed
Sequence Diagram
sequenceDiagram participant Caller participant MCP participant Selected as Selected Surfnet :18899 participant Studio as Main Studio :18488 participant Main as Main Surfnet :8899 Caller->>MCP: "create Tessera scenario(surfnet_port=18899)" MCP->>Selected: Read market and mint accounts Selected-->>MCP: Selected Surfnet state MCP->>Studio: POST /v1/scenarios Studio-->>Caller: Editor URL without Surfnet identity Caller->>Studio: Play scenario Studio->>Main: surfnet_registerScenario Note over Selected,Main: Scenario is derived from Selected state but applied to MainPrompt To Fix All With AI
Reviews (5): Last reviewed commit: "feat(tessera): discover live markets and..." | Re-trigger Greptile