x/gov/types: NewProposal unnecessarily creates a Proposal object that’s discarded on any error #8571
Closed
2 of 4 tasks
Labels
good first issue
Type: Code Hygiene
General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Summary of Bug
This code could be improved to create the proposal only when the coast is clear
cosmos-sdk/x/gov/types/proposal.go
Lines 20 to 43 in ab24d0e
otherwise presently it expends RAM. Unfortunately because there are property assignments, memory is consumed. If it were just a variable declaration, it wouldn’t be a problem. To expend RAM, one could create many error-ing proposals.
For Admin Use
The text was updated successfully, but these errors were encountered: