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

[genesis] Allocation does not destroy the migrated timelock/gas coin when it is a "surplus" #5024

Open
miker83z opened this issue Jan 26, 2025 · 0 comments
Assignees
Labels
vm-language Issues related to the VM & Language Team

Comments

@miker83z
Copy link
Contributor

When the genesis is created through migration, the allocation process for timelocked or gas coins in favor of a list of validators includes a special "surplus" coin. This "surplus" coin is set aside during the transition from one validator's allocation to another's. Specifically, only a portion of its balance is used for a validator's allocation, while the remaining surplus may be utilized later for the next validator.

During this process, the last surplus timelocked coin picked during the execution of:

fn pick_objects_for_allocation<'obj>(

will be put in the list of timelocks to split, here:
self.timelocks_to_split

however, the original timelock object is never put in the list of objects to destroy
self.timelocks_to_destroy

This basically results in cloning the object.

Suggested change:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vm-language Issues related to the VM & Language Team
Projects
None yet
Development

No branches or pull requests

1 participant