Skip to content

Type alignment #27

@freesig

Description

@freesig

Type alignment is set to #[repr(C, align(4))] which seems to be an optimization for risk0.
We should review if this is the correct way to align.
The main issue is this is harmful to performance on the host side so this should be at least under a feature flag.
Something like:

#[derive(Clone, Debug, Hash)]
#[cfg_attr(feature = "zk_alignment", repr(C, align(4)))]
pub struct Address {
    pub words: [u32; 5],
}

Thoughts @pixelcircuits ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions