Skip to content
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: param store doesn't use gas kv #202

Merged
merged 3 commits into from
May 24, 2021

Conversation

egonspace
Copy link

@egonspace egonspace commented May 21, 2021

Description

Param store does not use gas store any more.

  • As a side effect of previous PR(chore: caching paramset #198), the gas consumption may vary depending on whether the param is cached or not.
  • When the server runs, it will always be cached, so it will not actually happen.
  • However, regardless of cache, gas consumption must always be constant.
  • In addition, crucially, it seems undesirable to consume gas because the param read is not the intended storage access for the user.
  • I confirmed Modified() function of param store is not used anywhere. So I could remove Modified() function and TransientStore from param store.

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@egonspace egonspace self-assigned this May 21, 2021
@egonspace egonspace added the A: improvement Changes in existing functionality label May 21, 2021
@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #202 (150811e) into v2/develop (dc15595) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           v2/develop     #202      +/-   ##
==============================================
- Coverage       53.51%   53.49%   -0.02%     
==============================================
  Files             653      653              
  Lines           47384    47376       -8     
==============================================
- Hits            25357    25345      -12     
- Misses          19171    19177       +6     
+ Partials         2856     2854       -2     
Impacted Files Coverage Δ
x/params/types/subspace.go 75.00% <100.00%> (-0.81%) ⬇️
store/types/gas.go 73.17% <0.00%> (-21.96%) ⬇️
x/wasm/internal/keeper/keeper.go 86.90% <0.00%> (+0.37%) ⬆️
snapshots/store.go 75.40% <0.00%> (+1.09%) ⬆️

}

// Returns a transient store for modification
func (s *Subspace) transientStore(ctx sdk.Context) sdk.KVStore {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the function transientStore is removed, it seems that the tKey is also unused. we can remove it too. (However, API change has occurred, and consumer's additional action is required.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it in other PR.

types/context.go Outdated
Comment on lines 232 to 236
// TransientStore fetches a TransientStore from the MultiStore.
func (c Context) TransientStore(key StoreKey) KVStore {
return gaskv.NewStore(c.MultiStore().GetKVStore(key), c.GasMeter(), stypes.TransientGasConfig())
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing this function has no direct relevance to this PR. (although it is useless yet.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I will put this back and remove the TransientStore in another PR at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: improvement Changes in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants