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

pcli: use a default timeout height for ibc withdrawals #3558

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

avahowell
Copy link
Contributor

Closes #3206 . Won't work until we have implemented the remaining IBC queries (currently all the channel ones are missing)

@conorsch
Copy link
Contributor

conorsch commented Jan 4, 2024

Won't work until we have implemented the remaining IBC queries (currently all the channel ones are missing)

Added in #3572

Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

Requesting some clarification to aid my own understanding of the diff.

IbcChannelQueryClient::new(app.pd_channel().await?);

let req = QueryChannelRequest {
port_id: "transfer".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Side note: we hardcode "transfer" a lot of places, when referring to the IBC port. Should we not constify that value in the IBC crate somewhere, so we can tersely refer to it as the constant value it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do this, it's Portid::transfer() in ibc-types. i'll update this pr to use that

Some(h) => h.clone(),
None => {
// look up the height for the counterparty and add 2 days of block time
// (assuming 10 seconds per block) to it
Copy link
Contributor

Choose a reason for hiding this comment

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

Why assume 10s per block? Looking at the current Testnet 64, it looks like blocks actually take about 5s:

block-times

which I assume is coming from the cometbft value we set here: https://github.com/penumbra-zone/penumbra/blob/v0.64.1/testnets/cometbft_config_template.toml#L413

Copy link
Member

Choose a reason for hiding this comment

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

The number applies to counterparty chains, so we can't get it correct, since they all have different values, it'll just be an approximation. See

https://twitter.com/larry0x/status/1742764484144320997/photo/1

all the cosmos chains have different block times

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, of course. That makes a lot more sense!


IbcHeight {
revision_number: last_update_height.revision_number,
revision_height: last_update_height.revision_height + 87400,
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to question above: where does 87400 come from? 24 * 60 * 60 = 86400 but the comment at the top of the match suggests it should be two days, not one. Can we var this value and explain its construction in a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should be ((246060)/10) * 2, since we're assuming 10s per block

@avahowell
Copy link
Contributor Author

Updated with review comments

@conorsch
Copy link
Contributor

conorsch commented Jan 5, 2024

Awesome, thanks for explaining, @avahowell!

@conorsch conorsch merged commit 37b1eab into main Jan 5, 2024
7 checks passed
@conorsch conorsch deleted the withdraw-default-height branch January 5, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pcli: timeout height for ibc transfers should have default value
3 participants