Skip to content
9 changes: 9 additions & 0 deletions spell/star-spell-reviewer-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ This section outlines the review process and provides concrete action items for
- [ ] IF Prime Agent spell can not be executed in a later block OR have to be executed sequentially to another Prime Agent spell, `direct execution` is clearly mentioned in the forum post together with elaborated explanation why it is needed.
- [ ] The `direct execution` explanation makes sense on the technical level and can not be circumvented by the use of `isExecutable()` interface.

### Cross-Chain SVM Payload

- [ ] IF the spell triggers Solana actions via bridge:
- LIST every SVM payload referenced in this spell:
- [ ] **`SVM_ACTION_NAME`** from REPOSITORY_URL
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- [ ] Payload hex data is correctly referenced in the EVM spell contract.
- [ ] SVM payload has been reviewed using the SVM Payload Generation Checklist.
- [ ] IF multiple SVM payloads are triggered, execution order is correct and documented.
Comment thread
jonatascm marked this conversation as resolved.

#### On-boarding New Contracts
- LIST every new contract present in the spell:
- [CHAIN_NAME] `CONTRACT_NAME`, LINK_TO_THE_DEPLOYED_CONTRACT
Expand Down
110 changes: 110 additions & 0 deletions spell/svm-payload-generation-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# **SVM Spell Payload Generation Checklist**

This checklist complements the EVM Prime Agent Spells Reviewer Checklist for cross-chain governance payloads that execute on Solana via Bridge.

## **SVM Spell Payload Generation Review Process**

### **Development Stage**

**Preparation**
Comment thread
jonatascm marked this conversation as resolved.
Outdated

- LIST every spell action being deployed:
- **`SCRIPT_NAME`**, scripts/SCRIPT_NAME/
- [ ] Spell directory contains generate-payload.ts, validate.ts, and config.ts.
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- [ ] No unrelated files or changes in the solana payload generation directory.
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- [ ] Correct NETWORK_CONFIGS exported for both devnet and mainnet.
- [ ] Single ACTION per payload scripts

**Spell Description & Comments**

- [ ] Spell has clear description of Solana state changes.
- [ ] Every significant action is clearly commented in generate-payload.ts.
- [ ] Every account and parameter has valid source url (forum post, poll).
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- [ ] Every parameter is clearly commented with expected before/after values.

**Proposed changes**

- LIST every forum post proposing changes for this spell:
- FORUM_POST_TITLE, FORUM_POST_URL
- [ ] Forum post follows governance template.
- [ ] Verify spell content matches the combined scope of the forum posts listed above.
- [ ] Verify forum posts contain all Solana addresses (programs, PDAs, tokens) used in the spell.

**Network Configuration**

For each ACTION executed list:

- [ ] `ACTION` in scripts/SCRIPT_NAME
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- IF constants in src/ are used or were modified:
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- LIST every constant used from src/:
- **`CONSTANT_NAME`** in src/FILE_NAME.ts: **`VALUE`** from EXTERNAL_SOURCE_URL
- [ ] Value matches valid external source.
- [ ] Constant is used correctly in spell config.
- LIST network configurations from config.ts:
- [devnet/mainnet/others] NETWORK_CONFIG_NAME, LIST every target account:
- **`ACCOUNT_NAME`**: **`PUBKEY`** from EXTERNAL_SOURCE_URL
- Address matches valid external source.
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- Account exists on target network.
- Account owner matches expected program.

**State Change Verification**

- LIST every account:
- **`ACCOUNT_ADDRESS`** (ACCOUNT_NAME)
- LIST every field that should change:
- **`FIELD_NAME`** from **`OLD_VALUE`** to **`NEW_VALUE`** from EXTERNAL_SOURCE_URL
- [ ] Value change matches external source.
- [ ] Simulation shows correct state change.
- LIST every field that should NOT change:
- **`FIELD_NAME`** remains **`VALUE`**
- [ ] Simulation confirms field is unchanged.

**Code Structure & Quality**

- [ ] No unused imports, interfaces, or variables.
- [ ] All addresses are valid Solana public keys.
- [ ] Instruction data encoding matches target program interface.
- [ ] No hardcoded addresses where config values should be used or constants in source

**Dependency checks**

- LIST every package used in the spell:
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- **`PACKAGE_NAME@VERSION`**
- [ ] Version matches package.json.
- [ ] Package is updated or in a safer version
- [ ] Anchor/SDK version matches program deployment.

**Payload Generation**

- [ ] Run generation script: **`NETWORK=[network] ts-node ./scripts/SCRIPT_NAME/generate-payload.ts --file FILENAME`**
- [ ] Output file created: **`FILENAME-NETWORK.txt`**
- [ ] Payload contains hex-encoded data (no errors in generation).

### **Validation Stage**
Comment thread
jonatascm marked this conversation as resolved.
Outdated

**Simulation Execution**

- [ ] Run validation script: **`NETWORK=[network] ts-node ./scripts/SPELL_NAME/validate.ts --file FILENAME`**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think in order for the validate output to make sense, its contents first needs to be inspected (with the same attention to addresses as the in the generate-payload file)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll need more context for this one, but as far as I know, there will be an audit reviewing the generation code. We'll only be confirming whether the generated text is correct through simulation and re-running the generation. The process is still under construction

- [ ] Simulation completes successfully (no errors).
- [ ] All expected logs are present.
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- [ ] No unexpected program invocations.

**Testing**

- LIST each spell action (each instruction in the payload):
- INTENDED_SPELL_ACTION tested via TEST_NAME in validate.ts
- [ ] Test ensures the new value was set correctly.
- [ ] Test uses **`assertNoAccountChanges`** for accounts that shouldn't change.
- [ ] Test verifies account state before and after.
Comment thread
jonatascm marked this conversation as resolved.
Outdated
- [ ] All actions are covered by validation tests.
- [ ] All assertions pass locally at COMMIT_HASH:

```
EXECUTED_TESTS_LOGS
```
Comment thread
jonatascm marked this conversation as resolved.
Outdated

**Output**

For each `ACTION` list the payload generated:

- [ ] `ACTION_NAME`, `payload`
Comment thread
jonatascm marked this conversation as resolved.
Outdated