-
Notifications
You must be signed in to change notification settings - Fork 305
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
ibc: fix connection paths to use ibc-types #3118
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0af09fe
ibc: fix connection paths (use ibc-types for externally verified paths)
avahowell fa74178
ibc: add ClientPaths for tracking connections by client
avahowell 0fee6d4
use new ibc-types 0.6.3 release
avahowell dacd417
prefix processedHeights and processedTimes
avahowell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,44 +8,17 @@ pub fn ibc_params() -> &'static str { | |
"ibc/params" | ||
} | ||
|
||
// TODO (ava): move these to ibc-types eventually | ||
// these are internal helpers that are used by penumbra-ibc, but not part of the IBC spec (that is, | ||
// counterparties don't expect to verify proofs about them) | ||
pub fn client_processed_heights(client_id: &ClientId, height: &Height) -> String { | ||
format!("ibc/clients/{client_id}/processedHeights/{height}") | ||
format!("clients/{client_id}/processedHeights/{height}") | ||
} | ||
pub fn client_processed_times(client_id: &ClientId, height: &Height) -> String { | ||
format!("ibc/clients/{client_id}/processedTimes/{height}") | ||
format!("clients/{client_id}/processedTimes/{height}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if these aren't to be used by counterparties, and are component-internal, should we be prefixing them like the other component keys? |
||
} | ||
|
||
pub mod connections { | ||
use ibc_types::core::client::ClientId; | ||
use ibc_types::core::connection::ConnectionId; | ||
|
||
use std::string::String; | ||
|
||
// This is part of the ICS-3 spec but not exposed yet: | ||
// https://github.com/cosmos/ibc/tree/main/spec/core/ics-003-connection-semantics | ||
#[allow(dead_code)] | ||
pub fn by_client_id_list(client_id: &ClientId) -> String { | ||
format!("ibc/clients/{client_id}/connections/") | ||
} | ||
|
||
pub fn by_client_id(client_id: &ClientId, connection_id: &ConnectionId) -> String { | ||
format!( | ||
"ibc/clients/{}/connections/{}", | ||
client_id, | ||
connection_id.as_str() | ||
) | ||
} | ||
|
||
pub fn by_connection_id(connection_id: &ConnectionId) -> String { | ||
format!("ibc/connections/{}", connection_id.as_str()) | ||
} | ||
|
||
pub fn counter() -> &'static str { | ||
"ibc/ics03-connection/connection_counter" | ||
} | ||
pub fn counter() -> &'static str { | ||
"ibc/connection_counter" | ||
} | ||
|
||
pub fn ics20_value_balance(channel_id: &ChannelId, asset_id: &asset::Id) -> String { | ||
format!("ibc/ics20-value-balance/{channel_id}/{asset_id}") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
side point, but, i think we should change the
ibc-types
crate to make the feature be calledserde
rather thanwith_serde
, since that's a more conventional nameThere 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.
@hdevalence Cargo gets confused when using colliding feature names that overlap with an optional dependency, even if you specify
dep:serde
, I never was able to find a way to bundle theserde = [dep:serde, dep:serde_derive]
etc. maybe it's a skill issue.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.
yeah, i remember it being annoying to figure out. it seems potentially worth it longer-term though.
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.
Cargo would not complain about it but the end result is that, somehow,
serde_derive
would not be available to the consumer crate (internal to the ibc-types graph)