Skip to content

Update hash aliaces #2542

@Fumuran

Description

@Fumuran

To follow the other convention:

/// SMT node representation (32-byte Keccak256 hash)
pub type SmtNode = Keccak256Output;

/// Exit root representation (32-byte Keccak256 hash)
pub type ExitRoot = Keccak256Output;

We should:

  • Create the aliases for the leaf value and CGI chain hash.
  • Add a Keccak256Output::from_hex constructor.
  • Move the Keccak256Output definition from claim_note.rs into utils.rs. ExitRoot and SmtNode aliases can stay in claim_note.rs.

GlobalIndex struct duplicates a lot of the functionality of Keccak256Output, so we should rework the GlobalIndex struct into a trait which will extend Keccak256Output with the extra methods. These extended methods seem to be anyway used only for testing, so this new trait could have a cfg(test) attribute.

Originally posted by @mmagician in #2516 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agglayerPRs or issues related to AggLayer bridging integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions