Skip to content

non working --use_poseidon flag on cairo-hash-program cli arg v0.13.1 #184

@rkdud007

Description

@rkdud007

Context


--use_poseidon flag is not working properly in this cli argument

cairo-hash-program --use_poseidon false --program compiled_cairo/v1_hdp.json
0x36b89f0e160f103b39a8a6fb0d3271833225aeea2bb00d0c1cf06f4a6de0445

cairo-hash-program --use_poseidon true --program compiled_cairo/v1_hdp.json
0x36b89f0e160f103b39a8a6fb0d3271833225aeea2bb00d0c1cf06f4a6de0445

cairo-hash-program --program compiled_cairo/v1_hdp.json
0x71e9f412ed7dd8c0cc82f15a4739e35b958e2efe9d6b5b0bed937b8389dc9f0

cairo-hash-program --use_poseidon trudddde --program compiled_cairo/v1_hdp.json
0x36b89f0e160f103b39a8a6fb0d3271833225aeea2bb00d0c1cf06f4a6de0445

basically any thing after --use_poseidon flag, will route it to hash in poseidon. And I could not even use this flag without some value ( which is pretty confusing ).

cairo-hash-program --use_poseidon --program compiled_cairo/v1_hdp.json

usage: cairo-hash-program [-h] [-v] --program PROGRAM [--flavor {Debug,Release,RelWithDebInfo}] [--use_poseidon USE_POSEIDON]
cairo-hash-program: error: argument --use_poseidon: expected one argument

Suggested change

Would like to have , simply, if I pass --use_poseidon , will consider as true ( use poseidon hash for compute program hash ) if i don't pass that flag, use pedersen as before.

parser.add_argument(
    "--use_poseidon",
    action="store_true",  # Automatically stores True if --use_poseidon is exist, otherwise False.
    help="Use Poseidon hash.",
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions