-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lc/starknet): verify signed commitment proofs from starknet (#242)
* update ibc-client-cw patch branch * fix cw context methods * impl cw client state execution for starknet * add membership proof signer * sign connection open try message * ignore client and consensus proof * open ack proof * todo comment * generate membership proof message at starknet payload * membership proof msg for channel end * membership proof msg for packet commitment * membership proof msg for packet ack * membership proof msg for packet receipt * rename field in StarknetCommitmentProof * rm redundant todos * sign self client and consensus state proofs * use chain_status height as proof height * add tiny-bip39 dep * proof_signer components * add proof_signer field to StarknetChain * generate secp256k1 keypair from felt signing key * sign with starknet proof signer * nits * rm redundant endpoint * use packet_receipt endpoint * ibc-go compatible packet commitment * test consistent packet commitment in cairo and rust * happy clippy * rm test steps with dummy proofs * cargo fmt * cargo clippy * update expected commitment hash after fix
- Loading branch information
Showing
42 changed files
with
547 additions
and
225 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use ibc_client_cw::api::CwClientStateExecution; | ||
use ibc_client_cw::context::client_ctx::CwClientExecution; | ||
|
||
use super::ClientState; | ||
use crate::ConsensusState; | ||
|
||
impl<'a, E> CwClientStateExecution<'a, E> for ClientState | ||
where | ||
E: CwClientExecution<'a, ClientStateMut = ClientState, ConsensusStateRef = ConsensusState>, | ||
{ | ||
fn public_key(&self) -> Option<Vec<u8>> { | ||
Some(self.0.pub_key.clone()) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod common; | ||
pub mod cw; | ||
pub mod execution; | ||
pub mod validation; | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
28 changes: 28 additions & 0 deletions
28
relayer/crates/starknet-chain-components/src/impls/proof_signer.rs
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use core::marker::PhantomData; | ||
|
||
use cgp::prelude::*; | ||
|
||
use crate::traits::proof_signer::{ | ||
HasStarknetProofSignerType, ProvideStarknetProofSignerType, StarknetProofSignerGetter, | ||
}; | ||
|
||
pub struct GetStarknetProofSignerField<Tag>(pub PhantomData<Tag>); | ||
|
||
impl<Chain, Tag> ProvideStarknetProofSignerType<Chain> for GetStarknetProofSignerField<Tag> | ||
where | ||
Chain: Async + HasField<Tag>, | ||
Tag: Async, | ||
Chain::Value: Async, | ||
{ | ||
type ProofSigner = Chain::Value; | ||
} | ||
|
||
impl<Chain, Tag> StarknetProofSignerGetter<Chain> for GetStarknetProofSignerField<Tag> | ||
where | ||
Chain: Async + HasStarknetProofSignerType + HasField<Tag, Value = Chain::ProofSigner>, | ||
Tag: Async, | ||
{ | ||
fn proof_signer(chain: &Chain) -> &Chain::ProofSigner { | ||
chain.get_field(PhantomData) | ||
} | ||
} |
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
Oops, something went wrong.