Skip to main content

constant

Function constant 

Source
pub fn constant(
    g: &mut Graph,
    label: &'static str,
    output_type: &'static TypeNode,
    data_type: DataType,
) -> Output
Expand description

Record a typed Constant syscall NodeProto. Bootstrap-stage constants seed the AddressBook + GlobalRegistry ops with the server’s PeerId and dial bag at install time. The compiler’s expand_constant pass requires value: TensorProto; this helper satisfies that contract with an empty tensor sized for the declared scalar kind.

label rides on metadata_props under ai.bytesandbrains.bootstrap.seed for diagnostics. output_type is the recorded &'static TypeNode consumers downcast on (TYPE_PEER_ID, TYPE_ADDRESS_VEC, …).