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

NonZero parameter types #3347

Closed
grarco opened this issue Jun 2, 2024 · 5 comments
Closed

NonZero parameter types #3347

grarco opened this issue Jun 2, 2024 · 5 comments

Comments

@grarco
Copy link
Contributor

grarco commented Jun 2, 2024

We should consider changing some of the primitive integer parameters to their NonZero equivalent

Originally posted by @sug0 in #3318 (comment)

@brentstone
Copy link
Collaborator

how meticulous should we be about this? If we want, we can change a lot of protocol and genesis params?

@cwgoes
Copy link
Contributor

cwgoes commented Jun 7, 2024

Does this type change also change the formatting which must be used in the genesis parameter files?

@Fraccaman
Copy link
Member

it does yeah

@tzemanovic
Copy link
Member

I don't think it changes format- they have the same layout and bit validity except for 0.

That being said, I don't know if using NonZero types gives us much benefit except for rejecting 0. Alternatively we could put any invariants in fn validate_parameters in crates/apps_lib/src/config/genesis/templates.rs and each VP that has parameters should also guard its invariants in its VP implementation (see e.g. crates/proof_of_stake/src/parameters.rs fn validate). I think this is more flexible as we can express more rules than just non-zero.

@Fraccaman
Copy link
Member

Okay makes sense I think we can close this one then.

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

No branches or pull requests

5 participants