0xMiden / 0xMiden/protocol

BlockProof serialization is a silent no-op (TODO placeholder)

Offen
#3,140 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

`crates/miden-protocol/src/block/block_proof.rs:28-37`

`BlockProof::write_into` is a no-op:

```rust
impl Serializable for BlockProof {
fn write_into(&self, _target: &mut W) {
// TODO: Implement serialization
}
}
```

And `read_from` returns an empty struct:

```rust
impl Deserializable for BlockProof {
fn read_from(_source: &mut R) -> Result {
// TODO: Implement deserialization
Ok(Self {})
}
}
```

If a `BlockProof` is ever serialized or deserialized in production code, it will silently produce corrupt data — the bytes won't represent the actual proof, and deserialization will always return an empty `BlockProof` regardless of input.

The `BlockProof` struct has no fields currently (block_proof.rs:24-26), so serialization is technically lossless, but once fields are added (which the TODO implies is planned), the empty serialization becomes a data corruption bug. Adding a panic or compile-time assertion would prevent silent data loss when fields are added.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.