0xMiden / 0xMiden/miden-vm

Support executable MastForest generation with syscalls, externals, and dyn nodes

Đang mở
#2,341 4 bình luận 0 reaction 1 người được giao Được @surajk-m nhận Xem trên GitHub
tests
Ngôn ngữ chính
Rust
Star
772
Fork
352
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
93

Mô tả

### Feature description

The MastForest Arbitrary implementation generates non-executable forests when including certain node types:

1. **Syscalls**: Generated with random procedure digests - fail to execute without matching kernel procedures
2. **External nodes**: Use random digests that don't correspond to valid procedures
3. **Dynamic nodes**: Leave junk on the stack and cannot execute properly

Currently users must set these to 0 for executable forests, limiting execution testing using this strategy.

See https://github.com/0xMiden/miden-vm/pull/2335#discussion_r2486834656
https://github.com/0xMiden/miden-vm/pull/2335#discussion_r2486842056
https://github.com/0xMiden/miden-vm/pull/2335#discussion_r2486848817

### 1. Add kernel_procedures field to MastForestParams

```rust
pub struct MastForestParams {
// ... existing fields
/// Optional procedure hashes for syscall generation
pub kernel_procedures: Option>,
}
```

When generating syscalls, randomly select from provided hashes. Could also generate a matching kernel containing the procedure hashes.

### 2. Support executable external nodes

Add `external_procedures: Option>` field or make external nodes reference existing basic blocks within the same forest.

### 3. Consider kernel generation support

Add `generate_kernel: bool` field to generate both forest AND compatible kernel, returning `(MastForest, Kernel)`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.