Open plafer opened 3 weeks ago
I haven't looked into the serialization code in detail, but just to clarify, the intent is to make the serialization format look like this?
//! The serialization format of MastForest is as follows:
//!
//! (Metadata)
//! - MAGIC
//! - VERSION
//!
//! (lengths)
//! - nodes length (`usize`)
//!
//! (procedure roots)
//! - procedure roots (`Vec<MastNodeId>`)
//!
//! (raw data)
//! - Node data
//! - String table
//!
//! (info structs)
//! - MAST node infos (`Vec<MastNodeInfo>`)
//!
//! (All Decorator data)
//! - decorators length (`usize`)
//! - Decorator data
//! - decorator infos (`Vec<DecoratorInfo>`)
//!
//! (before enter and after exit decorators)
//! - before enter decorators (`Vec<(MastNodeId, Vec<DecoratorId>)>`)
//! - after exit decorators (`Vec<(MastNodeId, Vec<DecoratorId>)>`)
I think it is a bit more complicated than that because some decorator data is also stored in the "Node data" section and also strings used by decorators are stored in the "String table" (though, I don't remember this too well now).
But the general idea is correct - we want to move everything decorator-related to the end of the file to make removing decorator data (which is going to be primarily used for debug purposes) as straight-forward as possible.
_Originally posted by @bobbinth in https://github.com/0xPolygonMiden/miden-vm/pull/1482#discussion_r1751216993_