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

Only change rootmultistore hash when substore hashes change #4613

Merged
merged 4 commits into from
Jun 25, 2019

Conversation

ethanfrey
Copy link
Contributor

@ethanfrey ethanfrey commented Jun 24, 2019

Closes #1351

The fix was proposed one year ago, and was recently moved to "proposal accepted". This enables no-empty-block to be enabled with cosmos-sdk code without any other breaking changes.

  • 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.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added a relevant changelog entry: clog add [section] [stanza] [message]

  • rereviewed Files changed in the github PR explorer

Note: I don't know of any relevant documentation as this is a bugfix. Please point me to any points I need to update if any.


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Jun 24, 2019

Codecov Report

Merging #4613 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #4613      +/-   ##
==========================================
+ Coverage   53.62%   53.63%   +0.01%     
==========================================
  Files         260      260              
  Lines       16177    16177              
==========================================
+ Hits         8675     8677       +2     
+ Misses       6856     6854       -2     
  Partials      646      646

@ethanfrey ethanfrey marked this pull request as ready for review June 24, 2019 11:35
@ethanfrey
Copy link
Contributor Author

Please note that this issue was brought up as a problem by some groups during the Hackatom Berlin.

Also, this not being resolved has prompted other quick fixes, which would have much more breaking impacts, such as cosmos/iavl#143

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.

Concept ACK. I'm pretty sure this is state machine breaking, this I've added the label. Non-contentious update regardless. Thanks @ethanfrey 👍

Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

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

Nihil obstat from me

@ethanfrey
Copy link
Contributor Author

Concept ACK. I'm pretty sure this is state machine breaking, this I've added the label. Non-contentious update regardless. Thanks @ethanfrey +1

Yes, this will break all app hashes and require a chain restart for an upgrade to new version. I am fine if this merge waits until there are other state-machine breaking changes lined up, to all go in one release.

@alexanderbez
Copy link
Contributor

@ethanfrey we have a significant amount of breaking changes already in master and ready for the next major upgrade. I see no reason we can't get this in now :)

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.

Concept ACK, code utACK

We should note somewhere that applications which utilize no_empty_blocks will not have regular block timing and should use e.g. BFT timestamps for any periodic EndBlock / BeginBlock logic.

@alexanderbez
Copy link
Contributor

alexanderbez commented Jun 24, 2019

We should note somewhere that applications which utilize no_empty_blocks will not have regular block timing and should use e.g. BFT timestamps for any periodic EndBlock / BeginBlock logic.

Suggestions on a location @cwgoes?

@cwgoes
Copy link
Contributor

cwgoes commented Jun 24, 2019

Suggestions on a location @cwgoes?

In the default configuration file and in comments above EndBlock in the module abstraction perhaps.

@mdyring
Copy link

mdyring commented Jun 25, 2019

Thanks for the work on this @ethanfrey - much appreciated!

@ethanfrey
Copy link
Contributor Author

Concept ACK, code utACK

What does utACK mean?

I will add comments about no_empty_blocks to the two suggested locations later on today.

@cwgoes
Copy link
Contributor

cwgoes commented Jun 25, 2019

What does utACK mean?

Acknowledged (read the code, looks correct) but untested.

I will add comments about no_empty_blocks to the two suggested locations later on today.

Thanks.

@jackzampolin
Copy link
Member

Is this something we want to get in for gaia 1.0?

@alexanderbez
Copy link
Contributor

@jackzampolin yes. I'll be merging this once @ethanfrey updates some docs.

@ethanfrey
Copy link
Contributor Author

I rebased on master and added some comments to BeginBlocker/EndBlocker interfaces, which will be used be developers.

baseapp.BaseApp.{Begin,End}Block seemed like large code blocks that only core devs look at, so I didn't add docs there (but could if you want).

I could not find the default configuration besides client/config.go with no mention of no_empty_blocks in any toml file in the database. I assume this comes from the tendermint default toml file and the comment would have to go there:

https://github.com/tendermint/tendermint/blob/4253e67c07c69be6d7f7263ab03944ce30a9fc90/config/toml.go#L294-L297

(I also see that the name is now create_empty_blocks and will update the docs accordingly)

@ethanfrey
Copy link
Contributor Author

I just found this PR: https://github.com/cosmos/cosmos-sdk/pull/2284/files

I guess I should revert that as well. Does that belong in this PR or another one?

@alexanderbez
Copy link
Contributor

alexanderbez commented Jun 25, 2019

I just found this PR: https://github.com/cosmos/cosmos-sdk/pull/2284/files

I guess I should revert that as well. Does that belong in this PR or another one?

Yes, let's create another PR for that too.

I think we can safely merge this.

@mostcute
Copy link

mostcute commented Sep 5, 2019

@alexanderbez @ethanfrey
Hey friends,I want to support create-empty-block=false but i don't want to update my sdk version. how many changes i have to merge to my code? my sdk version is 0.34.4
I have merge the diff in #4613 && #4624.
and set the config.toml as

timeout_commit = "1s"

# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
skip_timeout_commit = false

# EmptyBlocks mode and possible interval between empty blocks
create_empty_blocks = false
create_empty_blocks_interval = "10s"

But my program still product block per second

I have read more discuss about this function

#1351 (comment)

It seems the slashing and distribution prevent the "no_empty_block" function.
Is that ture i can get the func after i remove the two modules?
Does any other module affect this function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Store T: State Machine Breaking State machine breaking changes (impacts consensus).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

store: remove Version from CommitID
7 participants