Skip to content

Investigate addition of IBCModule v2 application interface #7359

@damiannolan

Description

@damiannolan

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

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions