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

Investigate addition of IBCModule v2 application interface #7359

Open
2 of 8 tasks
Tracked by #7345
damiannolan opened this issue Oct 1, 2024 · 1 comment
Open
2 of 8 tasks
Tracked by #7345

Investigate addition of IBCModule v2 application interface #7359

damiannolan opened this issue Oct 1, 2024 · 1 comment
Assignees
Labels
feat: ibc-eureka needs discussion Issues that need discussion before they can be worked on needs investigation Issues that need some research before deciding approach or feasibility

Comments

@damiannolan
Copy link
Member

damiannolan commented Oct 1, 2024

Summary

IBC eureka/v2 protocol will introduce a new Packet type and commitment structure design informed by cosmos/ibc#1149
As the current IBCModule interface defined in 05-port/types depends on the current(classic) IBC packet, the proposed changes lends itself to introducing a new IBCModule interface with a more fine-grained and reduced API.

Proposal

This proposal has been informed by proof-of-concept work which experimented with a v2 IBCModule interface including variations of the following methods.
This should be further explored within the context of IBC protocol v2 / eureka and vetted for viability. The IBCModule interface is reduced to 4 concise methods for packet handling, eliminating handshake handlers from the IBC app design.

type IBCModule interface {
	OnSendPacket(
		ctx context.Context,
		sourceID string,
                 destinationID string,
		sequence uint64,
		data channeltypesv2.PacketData,
		signer sdk.AccAddress,
	) error

	OnRecvPacket(
		ctx context.Context,
		sourceID string,
                 destinationID string,
		data channeltypesv2.PacketData,
		relayer sdk.AccAddress,
	) channeltypes.RecvPacketResult

	OnAcknowledgementPacket(
		ctx context.Context,
		sourceID string,
                 destinationID string,
		data channeltypesv2.PacketData,
		acknowldgement []byte,
		relayer sdk.AccAddress,
	) error

	OnTimeoutPacket(
		ctx context.Context,
		sourceID string,
                 destinationID string,
		data channeltypesv2.PacketData,
		relayer sdk.AccAddress,
	) error
}

The above is a recommended starting point and intended to be tuned as progress is made on the surrounding parts of the implementation, and information is gathered.

A mock stubbed IBC app module can be created to implement the methods and run tests before moving forward with touching existing IBC apps.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
  • Estimate provided
@damiannolan damiannolan added feat: ibc-eureka needs discussion Issues that need discussion before they can be worked on needs investigation Issues that need some research before deciding approach or feasibility labels Oct 1, 2024
@chatton chatton self-assigned this Oct 2, 2024
@damiannolan
Copy link
Member Author

Needs discussion: decision is to explore if its viable to use an adapter pattern to wrap v1 module and route code through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: ibc-eureka needs discussion Issues that need discussion before they can be worked on needs investigation Issues that need some research before deciding approach or feasibility
Projects
Status: In progress
Development

No branches or pull requests

2 participants