💭 Change 🧠 Logic limits type in Protobuf #2
Closed
ccamel
started this conversation in
Axone Protocol
Replies: 3 comments 3 replies
-
All done. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
The
Limits
protobuf structure is designed to specify various constraints in thelogic
module, 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
string
type annotated to usecosmossdk.io/math.Uint
with a regularuint
type for the fieldsmax_size
,max_result_count
, andmax_user_output_size
within theLimits
protobuf definition.This change is based on the assessment that the range provided by the
uint64
type is more than sufficient for specifying the maximum size, result count, and user output size in practical scenarios in the protocol. Themax_gas
field will retain its current implementation usingcosmossdk.io/math.Uint
due to its association with currency values, which may require a broader range than what uint can offer.Changes to be made
max_size
fromstring
touint64
max_result_count
fromstring
touint64
max_user_output_size
fromstring
touint64
Unchanged
max_gas
Consequences
Positive:
uint
type simplifies the protobuf definition and makes it more straightforward for developers to understand and use improving the DX.Negative:
Neutral:
uint64
values 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:
Beta Was this translation helpful? Give feedback.
All reactions