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

Suggestion: Change height Parameter Type from int64 to uint64 in IUpgradeEntrypoint #85

Open
zsystm opened this issue Sep 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@zsystm
Copy link
Collaborator

zsystm commented Sep 5, 2024

Description and context

In the current implementation of the UpgradeEntrypoint interface, the height parameter in both the SoftwareUpgrade event and the planUpgrade function is defined as an int64. I suggest changing this type to uint64 for the following reasons:

  1. The block height is always non-negative, so int64 is unnecessary and could cause confusion.
  2. The processing logic already treats any height less than or equal to zero as an error (ref. link).
  3. Using uint64 makes the code clearer and safer by explicitly indicating that only non-negative values are allowed.

Suggested solution

Change int64 to uint64

Definition of done

  • Update related Solidity codes.
  • Deploy the new UpgradeEntrypoint
@zsystm zsystm added the enhancement New feature or request label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant