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

fix(network): Connection should include negotiated remoteAddress and localAddress #9186

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Apr 2, 2024

closes: #XXXX
refs: #9064

Description

After channelOpenAck, a negotiated version string is returned. When Connection is initiated, it includes the original localAddress and remoteAdddress instead of the negotiated ones.

This change propagates the localAddress and remoteAddress already provided to onConnectP to the Connection initializer, crossoverConnection. If an updated localAddress or remoteAddress is not available, fallback to the original ones from watchContext.

Before:

remoteAddress: '/ibc-hop/connection-0/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-0","hostConnectionId":"connection-1","address":"","encoding":"proto3","txType":"sdk_multi_msg"}'
localAddress: '/ibc-port/icacontroller-0'

After:

remoteAddress: '/ibc-hop/connection-0/ibc-port/icahost/ordered/{"version":"ics27-1","controller_connection_id":"connection-0","host_connection_id":"connection-1","address":"osmo1m30khedzqy9msu4502u74ugmep30v69pzee370jkas57xhmjfgjqe67ayq","encoding":"proto3","tx_type":"sdk_multi_msg"}/ibc-channel/channel-1'
localAddress: '/ibc-port/icacontroller-0/ibc-channel/channel-0'

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

Comment on lines 195 to 199
t.is(
remoteAddress,
'/ibc-hop/connection-11/ibc-port/port-98/unordered/bar-negotiated/ibc-channel/channel-22',
);
t.is(localAddress, '/ibc-port/port-1/ibc-channel/channel-1');
Copy link
Member Author

Choose a reason for hiding this comment

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

Before:

remoteAddress: '/ibc-hop/connection-11/ibc-port/port-98/unordered/bar'
localAddress: '/ibc-port/port-1'

Copy link
Member

Choose a reason for hiding this comment

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

I would even go further, and make it so that localAddress is /ibc-port/port-1/unordered/bar-negotiated/ibc-channel/channel-1. I think that's how (at least) vat-ibc.js behaved at one time.

Copy link
Member Author

Choose a reason for hiding this comment

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

@0xpatrickdev 0xpatrickdev marked this pull request as ready for review April 2, 2024 02:11
@0xpatrickdev 0xpatrickdev force-pushed the 9064-ica-remote-address branch 2 times, most recently from 6b6b19f to 0f95805 Compare April 2, 2024 16:05
Copy link
Contributor

@iomekam iomekam left a comment

Choose a reason for hiding this comment

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

LGTM!

@0xpatrickdev 0xpatrickdev added the automerge:rebase Automatically rebase updates, then merge label Apr 3, 2024
@mergify mergify bot merged commit a477bee into master Apr 4, 2024
73 of 74 checks passed
@mergify mergify bot deleted the 9064-ica-remote-address branch April 4, 2024 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants