Skip to main content

ns_lens_match_metadata

Function ns_lens_match_metadata 

Source
pub(crate) fn ns_lens_match_metadata(
    common: &AvidmGf2Common,
    ns_table: &[u8],
) -> bool
Expand description

Whether common.ns_lens are the namespace lengths an honest disperser derives from the header’s namespace table ns_table at the payload length the common claims, which the table must be sized for if it is one.

The commitment binds ns_commits but not ns_lens, so a leader could otherwise pair honest namespace commitments with lengths shuffled between namespaces. Such a block reconstructs and decides, but its stored common then slices the payload at the wrong namespace boundaries and no namespace proof for it can be served.

This pins ns_lens to the header. Whether the header’s table is sized for the payload is settled by matches_commitment at reconstruction, which sees the recovered bytes.