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

[cairo/ibc-core] only relayer should submit commitment proofs #228

Open
rnbguy opened this issue Jan 23, 2025 · 0 comments
Open

[cairo/ibc-core] only relayer should submit commitment proofs #228

rnbguy opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
Milestone

Comments

@rnbguy
Copy link
Member

rnbguy commented Jan 23, 2025

After #204, we now validate the sender in the client contract.

fn update_client(
ref self: ComponentState<TContractState>, msg: MsgUpdateClient
) -> UpdateResponse {
self.assert_owner();
self.update_validate(msg.clone());
self.update_execute(msg)
}

But we also need to authenticate the ibc-core messages that require membership proofs. Otherwise, spammers can submit empty dummy proofs successfully against any updated state root.

For example, for chan_open_try should start with a similar self.assert_owner() call here.

fn chan_open_try(
ref self: ComponentState<TContractState>, msg: MsgChanOpenTry
) -> ChannelId {
let channel_sequence = self.read_next_channel_sequence();
self.chan_open_try_validate(channel_sequence, msg.clone());
self.chan_open_try_execute(channel_sequence, msg)
}

We should do it for other handlers like conn_open_try, chan_open_ack, recv_packet, ack_packet etc -- anything that requires commitment proofs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants