-
Notifications
You must be signed in to change notification settings - Fork 375
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
chore: clean up the params
keeper
#3105
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3105 +/- ##
==========================================
- Coverage 63.77% 63.75% -0.03%
==========================================
Files 548 547 -1
Lines 78681 78701 +20
==========================================
- Hits 50180 50175 -5
- Misses 25117 25141 +24
- Partials 3384 3385 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
} | ||
} | ||
// findSlashPositions finds the positions of the first and second slashes in a path. | ||
// Returns the positions of the slashes and a boolean indicating if both slashes were found |
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.
// Returns the positions of the slashes and a boolean indicating if both slashes were found | |
// Returns the positions of the slashes or (-1, -1) if less than two slashes are found. |
Description
This PR cleans up a bit the
params
keeper, and starts a discussion on some functionality that seems sketchy. It moves some testing code outside the binary, and into test files.Additionally, I've updated some parsing methods so they're quicker now, by ~40ns:
Before:
The keeper could probably be fully made generic, but for the sake of readability, this was not pursued.
cc @gfanton @moul
Topics that need discussing:
Internal funky returns
gno/tm2/pkg/sdk/params/keeper.go
Lines 118 to 128 in 4f27a57
The method is called GetXXX, but it doesn't alter the pointer value internally if the value is missing.
Keeper (store) not being thread safe
The params keeper can be concurrently called, but it's not thread safe, actually. The underlying store is not thread safe
What if different modules concurrently call the keeper to store params?
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description