-
Notifications
You must be signed in to change notification settings - Fork 103
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
fix: data and ecocredit gas consumption #934
Conversation
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
==========================================
+ Coverage 72.34% 72.44% +0.10%
==========================================
Files 194 194
Lines 22892 22888 -4
==========================================
+ Hits 16562 16582 +20
+ Misses 5088 5051 -37
- Partials 1242 1255 +13
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice improvement.
|
||
// TODO: Revisit this once we have proper gas fee framework. | ||
// Tracking issue https://github.com/cosmos/cosmos-sdk/discussions/9072 | ||
const GasCostPerIteration = uint64(10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seams we are copying this value all over different places. Can we use it form a single place?
I know we are using a different modules, but maybe we can create some params module for that. (not necessary in this task). Something to discuss, not necessary do in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea. Although if we want to set module specific values, we might want to keep them within each module, same way we do module specific errors. Currently we use 10
for all iterations but we might want to have some iterations charge more gas than others. I thought about making those changes here but figured I would start with making sure we are at least charging some gas for each iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - some files have imports ungrouped
x/ecocredit/server/core/retire.go
Outdated
@@ -2,6 +2,7 @@ package core | |||
|
|||
import ( | |||
"context" | |||
"github.com/regen-network/regen-ledger/x/ecocredit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of these imports didn't appear to join the existing /regen-ledger/ group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just updated my golang preferences too. Thanks for sharing that over at the watercooler. 🙂
Description
Closes: #185
This pull request fixes and updates gas consumption for the data module and ecocredit module. Ensures gas consumption for all iterations as well as hash verification in the data module. Also updates gas consumption descriptions.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change