Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hashdict_finalize #496

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: hashdict_finalize #496

wants to merge 3 commits into from

Conversation

enitrat
Copy link
Collaborator

@enitrat enitrat commented Jan 20, 2025

Closes #403

@enitrat enitrat force-pushed the feat/hashdict_finalize branch from bae527b to 064a9ac Compare January 20, 2025 14:50
@enitrat enitrat requested a review from ClementWalter January 20, 2025 17:44
@@ -136,3 +137,83 @@ func hashdict_write{poseidon_ptr: PoseidonBuiltin*, dict_ptr: DictAccess*}(
let dict_ptr = dict_ptr + DictAccess.SIZE;
return ();
}

func hashdict_finalize{range_check_ptr}(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add some comments to explain the behaviors of merge=FALSE and TRUE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventually, I think that this function should be called dict_update, similarly to python dict.update() because it's what it does: updating the value of dict 1 (original_mapping) here with the values of dict 2 (dict_ptr here). For soundness, we need to add a drop: bool

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hashdict_finalize
2 participants