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

R4R: Configurable pruning #3195

Merged
merged 2 commits into from
Jan 9, 2019

Conversation

hleb-albau
Copy link
Contributor

@hleb-albau hleb-albau commented Dec 27, 2018

closes: #3194

Allows custom configuration for syncable strategy

@hleb-albau hleb-albau changed the title #3194 Configurable pruning WIP: #3194 Configurable pruning Dec 27, 2018
@hleb-albau hleb-albau force-pushed the 3194_configurable_pruning branch 3 times, most recently from 71fe7f3 to 32e43e4 Compare December 27, 2018 17:14
@codecov
Copy link

codecov bot commented Dec 27, 2018

Codecov Report

Merging #3195 into develop will increase coverage by 0.04%.
The diff coverage is 30.43%.

@@             Coverage Diff             @@
##           develop    #3195      +/-   ##
===========================================
+ Coverage    54.83%   54.88%   +0.04%     
===========================================
  Files          133      134       +1     
  Lines         9559     9551       -8     
===========================================
  Hits          5242     5242              
+ Misses        3996     3988       -8     
  Partials       321      321

@codecov
Copy link

codecov bot commented Dec 27, 2018

Codecov Report

Merging #3195 into develop will increase coverage by <.01%.
The diff coverage is 30.43%.

@@             Coverage Diff             @@
##           develop    #3195      +/-   ##
===========================================
+ Coverage    55.33%   55.33%   +<.01%     
===========================================
  Files          134      135       +1     
  Lines         9602     9594       -8     
===========================================
- Hits          5313     5309       -4     
+ Misses        3957     3953       -4     
  Partials       332      332

@hleb-albau hleb-albau changed the title WIP: #3194 Configurable pruning R4R: #3194 Configurable pruning Dec 27, 2018
@alexanderbez alexanderbez changed the title R4R: #3194 Configurable pruning R4R: Configurable pruning Jan 2, 2019
@alexanderbez alexanderbez added ready-for-review T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). labels Jan 2, 2019
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Thanks @hleb-albau. Left a bit of minor feedback. In addition, this needs a pending log update under the breaking section.


func NewPruningOptions(strategy string) (opt PruningOptions) {
switch strategy {
case "nothing":
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be constants defined in this file and used everywhere NewPruningOptions is called imho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still need this method to parse viper flag value. To be able to change default pruning options, baseapp should take not just strategy, but options itself. So we can't just pass strategy to ** baseapp**. Maybe I miss something?
Btw, I open PruneEverything, PruneNothing, PruneSyncable and change tests to use them, instead of this method.

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 this is OK for now.

types/store.go Outdated Show resolved Hide resolved
types/store.go Outdated Show resolved Hide resolved
@hleb-albau hleb-albau changed the title R4R: Configurable pruning WIP: Configurable pruning Jan 8, 2019
@hleb-albau hleb-albau changed the title WIP: Configurable pruning R4R: Configurable pruning Jan 8, 2019
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

ACK, thanks for the contribution!


func NewPruningOptions(strategy string) (opt PruningOptions) {
switch strategy {
case "nothing":
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 this is OK for now.

@cwgoes cwgoes merged commit 867f8a7 into cosmos:develop Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PruneSyncable configurable numRecent params.
3 participants