-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: dummy light client #25
Conversation
Btw, there is already a boiletplate crate at https://github.com/informalsystems/ibc-starknet/tree/main/light-client? |
Thank you @rnbguy for this PR 🙌 I, as well, suggest to set up the dummy light client within the boilerplate, as it eventually evolves to a fully fledged Starknet light client, and won’t be needing the dummy one in later phases. |
Overwritten the |
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.
@rnbguy Is there anything left to prepare the PR for review?
By the way, I requested a few minor tweaks. It would be beneficial to include a just
command and a CI job to check the build.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
#[derive(Clone, Debug, PartialEq, derive_more::From)] | ||
pub struct ClientState { | ||
pub latest_height: Height, |
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.
Just adding a comment in the context of this PR.
As discussed with Farhad, removing this field probably works with the IBC stack.
But it is good to have - as this would act as a debugging flag; to observe if an ClientUpdate
actually happened - because that increments this height.
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.
Looks good, except some minor nits.
Cargo.toml
Outdated
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.
Can we move the Cargo workspace to the project sub directory light-client/
? We could also create a top-level directory like starknet-on-cosmos
to host the Cargo workspace.
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.
I will let @Farhad-Shabani and you to decide this. Feel free to update my PR as I will be OOO.
use ibc_core::commitment_types::commitment::CommitmentRoot; | ||
use ibc_core::primitives::proto::{Any, Protobuf}; | ||
|
||
pub const CONSENSUS_STATE_TYPE_URL: &str = "/DummyConsensusState"; |
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.
Should we update the type URL to something like "/StarknetConsensusState"
?
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.
Let's get this merged first. We can continue rapid development on further PRs. |
Closes #7
This PR implements an
ibc-rs
light client - which doesn't validate anything. Its purpose is to bootstrap IBC workflow without having a fully working light client.This should be only used in debugging or testing scenarios.
Any
serialized ClientState, ConsensusState are as follows:Any
serialized Header can be anything. For example, it can take emptytype_url
andvalue
: