馃挱 Change 馃 Logic limits type in Protobuf #2
Closed
ccamel
started this conversation in
Axone Protocol
Replies: 3 comments 3 replies
|
All done. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context
The
Limitsprotobuf structure is designed to specify various constraints in thelogicmodule, including computational power (gas), exeuted program size, result count, and user output size. These limits are crucial for maintaining system performance, security, and resource allocation efficiency.Currently, all fields (
max_gas,max_size,max_result_count,max_user_output_size) uses a custom type,cosmossdk.io/math.Uint, to handle these constraints, offering potentially unlimited range for specifying these values. However, using such a type seems unnecessary considering the range of values these parameters typically hold.The goal of this conversation is to reflect on the proposal and gather feedback from the community to identify the most appropriate type choices for the interface.
Proposition
This proposal suggests replacing the
stringtype annotated to usecosmossdk.io/math.Uintwith a regularuinttype for the fieldsmax_size,max_result_count, andmax_user_output_sizewithin theLimitsprotobuf definition.This change is based on the assessment that the range provided by the
uint64type is more than sufficient for specifying the maximum size, result count, and user output size in practical scenarios in the protocol. Themax_gasfield will retain its current implementation usingcosmossdk.io/math.Uintdue to its association with currency values, which may require a broader range than what uint can offer.Changes to be made
max_sizefromstringtouint64max_result_countfromstringtouint64max_user_output_sizefromstringtouint64Unchanged
max_gasConsequences
Positive:
uinttype simplifies the protobuf definition and makes it more straightforward for developers to understand and use improving the DX.Negative:
Neutral:
uint64values are serialized as strings, the change in type should have a neutral impact on clients utilizing the JSON or YAML formats of the interface.Request for Community Feedback
This proposal seeks feedback from the community on the following points:
All reactions