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

ICS07 follow up changes #5606

Merged
merged 13 commits into from
Feb 18, 2020
Merged

ICS07 follow up changes #5606

merged 13 commits into from
Feb 18, 2020

Conversation

fedekunze
Copy link
Collaborator

@fedekunze fedekunze commented Feb 3, 2020

Description

Addresses comments from #5485 (review)
Implements changes from cosmos/ibc#367


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

Great start, still need to be able to pass in UnbondingPeriod/trustingPeriod as part of the CreateClient msg

x/ibc/02-client/keeper/keeper.go Outdated Show resolved Hide resolved
x/ibc/02-client/keeper/keeper.go Outdated Show resolved Hide resolved
@@ -21,18 +23,52 @@ var _ clientexported.ClientState = ClientState{}
type ClientState struct {
// Client ID
ID string `json:"id" yaml:"id"`
// Duration of the period since the LastestTimestamp during which the
// submitted headers are valid for upgrade
TrustingPeriod time.Duration `json:"trusting_period" yaml:"trusting_period"`
Copy link
Member

Choose a reason for hiding this comment

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

Do we need both trusting and unbonding? Can't we default trusting to a fraction of the unbonding period?

@melekes melekes closed this Feb 7, 2020
@fedekunze fedekunze reopened this Feb 7, 2020
) (exported.ClientState, error) {
var clientState exported.ClientState
height := uint64(ctx.BlockHeight())
Copy link
Member

Choose a reason for hiding this comment

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

Should not be using our own chain's BlockHeight here. Should be using the other chain's height.

Fixed this on my branch by adding Height field and GetHeight method to ConsensusState

fedekunze and others added 5 commits February 17, 2020 11:34
* refactor tendermint package to move msgs here

* fix rest of package to accomadate 07 refactor

* added GetHeight to ConsensusState and moved clientstate struct creation to 07-tendermint

* start work on making misbehavior retrieve consensusState LTE misbehavior

* allow misbehavior submission at height not equal to persisted consensusState

* optimize submitMisbehavior by erroring earlier

* cleanup misbehavior and propose lazy fix

* fix bug

* Update x/ibc/02-client/keeper/client.go

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* address fede review

* add chain-id into clientstate

* address necessary fede review

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
}

func (suite *KeeperTestSuite) SetupTest() {
testHeight = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary conversion (from unconvert)

}

func (suite *KeeperTestSuite) SetupTest() {
isCheckTx := false
suite.now = time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC)
now2 := suite.now.Add(time.Duration(time.Hour * 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary conversion (from unconvert)

isCheckTx := false
app := simapp.Setup(isCheckTx)
suite.now = time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC)
now2 := suite.now.Add(time.Duration(time.Hour * 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary conversion (from unconvert)

@fedekunze fedekunze marked this pull request as ready for review February 18, 2020 13:52
@fedekunze fedekunze added R4R and removed WIP labels Feb 18, 2020
@fedekunze fedekunze dismissed AdityaSripal’s stale review February 18, 2020 13:57

addressed on the follow up

@fedekunze fedekunze merged commit efb28d7 into ibc-alpha Feb 18, 2020
@fedekunze fedekunze deleted the fedekunze/ics07-follow-ups branch February 18, 2020 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants