-
Notifications
You must be signed in to change notification settings - Fork 585
move vesting update phase into Account.Hardfork.of_stable #18216
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
base: compatible
Are you sure you want to change the base?
Conversation
|
|
||
| let of_stable (account : Stable.Latest.t) : t = | ||
| (* This function converts Berkeley account to Mesa account *) | ||
| let of_stable ~hardfork_slot (account : Stable.Latest.t) : t = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the function we expect to expose to o1js's end. hardfork_slot is the slot where HF happen.
hardfork_slot is the slot when HF happen, in Mesa the slot time is different before/after this slot. This is needed only to patch vesting params. Which could be less relevant for testing zkApps. @Trivo25
| List.mapi stable_locations_and_accounts ~f:(fun i acct -> | ||
| ( Ledger.Hardfork_db.Addr.of_int_exn ~ledger_depth i | ||
| , Account.Hardfork.of_stable acct ) ) | ||
| , Account.Hardfork.of_stable ~hardfork_slot acct ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug.
| assert (Ledger_hash.equal start_hash (merkle_root ledger)) ; | ||
| (merkle_path ledger new_loc, Account.empty) | ||
|
|
||
| module Converting_for_tests = struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved some converting ledger funcs here. This is because with hardfork slot is not known here, and it's not used in anything other than tests.
| new_accounts ) | ||
| |> List.concat | ||
|
|
||
| let convert_and_apply_all_masks_to_ledger ~hardfork_db ({ ledger; _ } : t) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed as not used & requires hf slot present.
|
!ci-build-me |
This is a request from @Trivo25, having a function exposing the account conversion phase that o1js could refer to, for testing purpose.
Context: https://o1-labs.slack.com/archives/C02BFPS6BA4/p1765170746704759
I also discovered there's a bug when doing this: chunked migration doesn't have vesting param update in it.