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(test/relayer): missing consensus state in light_client #256

Merged
merged 17 commits into from
Feb 6, 2025

Conversation

rnbguy
Copy link
Member

@rnbguy rnbguy commented Feb 5, 2025

closes #241

@rnbguy
Copy link
Member Author

rnbguy commented Feb 5, 2025

My suggestion in the issue was wrong. I found the main cause. We build the client update payload from Cosmos not exactly at target_height. It actually recalls create-client-payload to create a header for the whatever-is-latest height at that moment.

async fn build_update_client_payload(
chain: &Chain,
trusted_height: &CosmosHeight,
// Ignore the target height for the dummy implementation
_target_height: &CosmosHeight,
_client_state: Chain::ClientState,
) -> Result<CometUpdateHeader, Chain::Error> {
let payload = chain
.build_create_client_payload(&Default::default())
.await?;

Not really sure why we are not reusing the client-update-payload-builder implementation from hermes-sdk. It does reuse the create-client-payload-builder from hemres-sdk.

@rnbguy
Copy link
Member Author

rnbguy commented Feb 5, 2025

Because we currently don't have TendermintClientState: From<CometClientState>.

@rnbguy rnbguy requested a review from soareschen February 5, 2025 21:35
@rnbguy rnbguy marked this pull request as ready for review February 5, 2025 21:36
@rnbguy rnbguy requested a review from Farhad-Shabani February 5, 2025 21:36
@@ -182,6 +182,14 @@ impl From<CometClientState> for Any {
}
}

impl From<CometClientState> for IbcCometClientState {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we just convert the two values directly? Or can we just use TendermintClientState as the type when interacting with the Cairo contract?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point ! We can use the types directly 👍🏽

Copy link
Member Author

@rnbguy rnbguy Feb 6, 2025

Choose a reason for hiding this comment

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

Let's tackle this in a separate issue.

We need to reuse Tendermint header, client and consensus state.

starknet_to_cosmos_relay
.send_target_update_client_messages(SourceTarget, &cosmos_status.height)
.await?;

// wait till the starknet_status is incremented
while starknet_status.height <= starknet_height {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this waiting for? Is the devnet not progressing right after a Call is processed?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. but I can delete it. I thought that was the main bug at first.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Farhad-Shabani Farhad-Shabani merged commit bfe0184 into main Feb 6, 2025
7 checks passed
@Farhad-Shabani Farhad-Shabani deleted the rano/fix-241 branch February 6, 2025 15:32
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.

missing consensus state at cairo contract
3 participants