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: adding sentinel path for solomachine header #2748

Merged
merged 7 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
### State Machine Breaking

* (light-clients/07-tendermint) [\#2554](https://github.com/cosmos/ibc-go/pull/2554) Forbid negative values for `TrustingPeriod`, `UnbondingPeriod` and `MaxClockDrift` (as specified in ICS-07).
* (06-solomachine) [\#2744](https://github.com/cosmos/ibc-go/pull/2744) `Misbehaviour.ValidateBasic()` now only enforces that signature data does not match when the signature paths are different.
* (06-solomachine) [\#2744](https://github.com/cosmos/ibc-go/pull/2744) `Misbehaviour.ValidateBasic()` now only enforces that signature data does not match when the signature paths are different.
* (06-solomachine) [\#2748](https://github.com/cosmos/ibc-go/pull/2748) Adding sentinel value for header path in 06-solomachine.
Comment on lines +72 to +73
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add these to the description of the PR too in conventional format! ❤️

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this correct?

chore(statemachine)!: Adding sentinel value for header path in 06-solomachine.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah that looks good!


### Improvements

Expand Down
3 changes: 3 additions & 0 deletions modules/light-clients/06-solomachine/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"github.com/cosmos/ibc-go/v6/modules/core/exported"
)

// SentinelHeaderPath defines a sentinel path used for solomachine header updates
damiannolan marked this conversation as resolved.
Show resolved Hide resolved
const SentinelHeaderPath = "solomachine:header"
Copy link
Contributor

Choose a reason for hiding this comment

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

should we match the proposed spec value? https://github.com/cosmos/ibc/pull/821/files#diff-028a9db43f8be864645baa5997fbb182b9af4cd9d444166944920c9fb25ee5fcR179

I'm okay proposing a different value in the spec as well

cc @AdityaSripal

Copy link
Member Author

Choose a reason for hiding this comment

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

Huh! I missed this was already part of the spec, my bad.
I actually feel like proposing a change, what do you think?

In my opinion solomachine:header feels a little easier on the eye than the capitalised snake case. Don't feel too strongly about it but just my two cents

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me!

Copy link
Member Author

Choose a reason for hiding this comment

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


var _ exported.ClientMessage = &Header{}

// ClientType defines that the Header is a Solo Machine.
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/06-solomachine/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (cs ClientState) verifyHeader(ctx sdk.Context, cdc codec.BinaryCodec, clien
Sequence: header.Sequence,
Timestamp: header.Timestamp,
Diversifier: cs.ConsensusState.Diversifier,
Path: []byte{},
Path: []byte(SentinelHeaderPath),
Data: dataBz,
}

Expand Down
2 changes: 1 addition & 1 deletion testing/solomachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (solo *Solomachine) CreateHeader(newDiversifier string) *solomachine.Header
Sequence: solo.Sequence,
Timestamp: solo.Time,
Diversifier: solo.Diversifier,
Path: []byte{},
Path: []byte(solomachine.SentinelHeaderPath),
Data: dataBz,
}

Expand Down