-
Notifications
You must be signed in to change notification settings - Fork 624
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
fix(api)!: remove Pretty
and String
custom implementations of MerklePath
#4459
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API breaking changes:
- Removing
String
andPretty
. - Removing
String
fromPath
interface.
In which section of the migration docs should we mention them?
@@ -28,7 +28,6 @@ type Prefix interface { | |||
// Path implements spec:CommitmentPath. | |||
// A path is the additional information provided to the verification function. | |||
type Path interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to keep the interface because there was an import cycle between 02-client and 23-commitment, if I tried to use commitmenttypes.MerklePath
as the type for path
in the Verify(Non)Membership
functions of the client state interface.
@@ -26,8 +26,6 @@ message MerklePrefix { | |||
// arbitrary structured object (defined by a commitment type). | |||
// MerklePath is represented from root-to-leaf | |||
message MerklePath { | |||
option (gogoproto.goproto_stringer) = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this so that the proto compiler generated an implementation of String
because that is needed when we do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the linked test should be updated to use a valid path for misbehaviour. A marshaled merkle path is not an expected singing path for solomachines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing it to be proto marshaled makes sense to me, but solo machine should not be proto marshaling the path when submitting misbeahviour, I think that might be a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! But we should not be referencing merkle path in solo machines anymore for testing. We should directly use the 24-host path
@@ -26,8 +26,6 @@ message MerklePrefix { | |||
// arbitrary structured object (defined by a commitment type). | |||
// MerklePath is represented from root-to-leaf | |||
message MerklePath { | |||
option (gogoproto.goproto_stringer) = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the linked test should be updated to use a valid path for misbehaviour. A marshaled merkle path is not an expected singing path for solomachines
merklePath := commitmenttypes.NewMerklePath(host.FullClientStatePath("counterparty")) | ||
path, err := solo.cdc.Marshal(&merklePath) | ||
require.NoError(solo.t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be removing merkle path usage in solo machines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! I will do that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be fixed in a followup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot change this one because we require at the moment the path to be a proto-marshalled MerklePath
when submitting misbehaviour. I will open an issue for this.
@colin-axner I implemented the feedback, but there's one thing I couldn't change and left a question in one of your comments |
# Conflicts: # modules/core/23-commitment/types/commitment.pb.go
Co-authored-by: Damian Nolan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, is there an issue for the misbehaviour unmarshaling fix?
|
||
require.Equal(t, "", zeroPath.String(), "zero element path does not have correct string representation") | ||
require.Equal(t, "", zeroPath.Pretty(), "zero element path does not have correct pretty string representation") | ||
require.Len(t, prefixedPath.GetKeyPath(), 2, "unexpected key path length") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this test be asserting what each element is in the key path?
@@ -26,8 +26,6 @@ message MerklePrefix { | |||
// arbitrary structured object (defined by a commitment type). | |||
// MerklePath is represented from root-to-leaf | |||
message MerklePath { | |||
option (gogoproto.goproto_stringer) = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing it to be proto marshaled makes sense to me, but solo machine should not be proto marshaling the path when submitting misbeahviour, I think that might be a bug
merklePath := commitmenttypes.NewMerklePath(host.FullClientStatePath("counterparty")) | ||
path, err := solo.cdc.Marshal(&merklePath) | ||
require.NoError(solo.t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be fixed in a followup?
Description
Second part of #4128. First part was #4429.
closes: #4128
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
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.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.