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

refactor!: remove unnecessary exported.ChannelI interface #5703

Merged
merged 6 commits into from
Jan 24, 2024

Conversation

colin-axner
Copy link
Contributor

Description

a feel good pr

removes the unncecessary interface exported.ChanelI. It shouldn't exist since we only have a single concrete implementation of Channel. It was likely originally added to avoid import cycles, but this obviously isn't an issue

closes: #XXXX

Commit Message / Changelog Entry

type: commit message

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.

  • Targeted PR against the 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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@colin-axner colin-axner added the type: code hygiene Clean up code but without changing functionality or interfaces label Jan 24, 2024
@@ -166,14 +166,6 @@ func (ClientState) VerifyConnectionState(
panic(errors.New("legacy solo machine is deprecated"))
}

// VerifyChannelState panics!
func (ClientState) VerifyChannelState(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are more stale funcs in this file that can be removed

- No relevant changes were made in this release.
### API removals

The `exported.ChannelI` interface has been removed. Please use the concrete type.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is your thinking on removal v deprecation? Do we flat out remove when we consider highly unlikely someone using it? (which is most definitely case here)

Would be nice to have a depreciation policy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My approach is to deprecate changes which are disruptive to users. Users shouldn't be using the exported.ChannelI interface (it was never intended to be used externally), as they likely need to cast to channeltypes.Channel, but if they are, the only diffs they have is changing from exported.ChannelI to channeltypes.Channel

I agree a deprecation policy would be nice, but I feel it might be good to give ourselves some flexibility in deciding on a case by case basis, as some removals are more disruptive than others

Copy link
Contributor

Choose a reason for hiding this comment

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

yup, makes sense. I think a deprecation policy would be nice to mention that and also enforce a timeline (i.e deprecations last for one major release) considering we have a number of deprecated things that seem to still be lurking around.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some other points that come to mind:

  • these changes can be applied pre-v9 (users can make the changes in a pr before bumping to v9, so the depreciation notice could actually be posted in the v8 release, but honestly don't think anyone will notice until the compiler breaks)
  • no functional changes

I feel those are 2 good points for justifying immediate removal. Maybe we can start bundling justifications in a document so it can be more formalized

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Good hygiene! :D

GetVersion() string
ValidateBasic() error
}

// CounterpartyChannelI defines the standard interface for a channel end's
// counterparty.
type CounterpartyChannelI interface {
Copy link
Member

Choose a reason for hiding this comment

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

wonder if its possible to remove this also?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, decided to tackle one interface at a time. I suspect some other interfaces can be removed as well

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

🧹

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

🧹 🧹 🧹

@colin-axner colin-axner enabled auto-merge (squash) January 24, 2024 15:32
@colin-axner colin-axner merged commit 203ea71 into main Jan 24, 2024
73 of 74 checks passed
@colin-axner colin-axner deleted the colin/rm-exported-channelI branch January 24, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: code hygiene Clean up code but without changing functionality or interfaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants