Skip to content

feat(scenarios): add reusable raw-layout overrides - #15

Open
bakasura980 wants to merge 2 commits into
feat/scenarios/protocols/kaminofrom
feat/scenarios/raw-layout
Open

bakasura980 wants to merge 2 commits into
feat/scenarios/protocols/kaminofrom
feat/scenarios/raw-layout

Conversation

@bakasura980

@bakasura980 bakasura980 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

The PR adds reusable byte-level account override layouts for programs without an IDL and routes them through scenario materialization.

  • Makes template IDLs optional and introduces raw encodings, account guards, and offset-based writes.
  • Validates raw-layout collections before registration and prevents partial insertion of malformed collections.
  • Adds raw-layout documentation and focused encoding, validation, and materialization tests.

Confidence Score: 4/5

The PR is not yet safe to merge because Studio cannot construct overrides from the newly exposed IDL-less raw-layout templates.

Raw-layout templates are returned with no IDL, but the coupled Studio editor still exits before account loading and exposes no raw-layout editing path, leaving the feature unusable through that supported client.

Files Needing Attention: crates/types/src/scenarios.rs and the coupled Studio scenario editor

Important Files Changed

Filename Overview
crates/types/src/scenarios.rs Adds the raw-layout wire and encoding model, but the optional IDL contract remains incompatible with Studio’s IDL-only editor flow.
crates/core/src/scenarios/registry.rs Refactors collection loading and now validates required raw-layout metadata before mutating the registry.
crates/core/src/surfnet/svm.rs Adds a raw-layout materialization path ahead of IDL lookup while preserving existing account metadata.
crates/core/src/scenarios/README.md Documents IDL-less templates, raw offsets, encodings, account guards, and large-integer input requirements.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    T[Raw-layout template] --> V[Validate layout and properties]
    V --> R[Register template without IDL]
    R --> S[Schedule scenario override]
    S --> G[Check account size and magic]
    G --> E[Encode supplied values]
    E --> W[Write bytes at configured offsets]
    W --> A[Update local SVM account]
Loading

Reviews (2): Last reviewed commit: "fix(scenarios): validate raw-layout temp..." | Re-trigger Greptile

Context used:

Comment thread crates/types/src/scenarios.rs
Comment thread crates/core/src/scenarios/registry.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant