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: exclude starknet signing key from relayer config file #334

Merged
merged 9 commits into from
Mar 4, 2025

Conversation

rnbguy
Copy link
Member

@rnbguy rnbguy commented Feb 28, 2025

closes #318

included an example relayer config file. after filling out the empty fields, we can relay packets via

RUST_LOG=trace hermes-starknet -c relayer.toml start cosmos-with-starknet \
  --chain-id-a 393402133025997798000961 --client-id-a 07-tendermint-3 \
  --chain-id-b osmo-test-5 --client-id-b 08-wasm-4459

@rnbguy rnbguy requested a review from soareschen February 28, 2025 11:19
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StarknetWallet {
pub account_address: StarknetAddress,
pub signing_key: Felt,
pub signing_key: SigningKey,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the signing key here should always be Felt. We should update the config to load the key from a path, and load the key before initializing the chain or wallet.

Copy link
Member Author

Choose a reason for hiding this comment

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


fn try_from(value: SigningKey) -> Result<Self, Self::Error> {
match value {
SigningKey::File { file } => Ok(std::fs::read_to_string(file)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an unexpected side effect, some more with blocking I/O, which would happen every time the field is used, which is not good.

Copy link
Member Author

@rnbguy rnbguy Mar 3, 2025

Choose a reason for hiding this comment

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

Maybe I have to do the same way you do it for CosmosChainConfig

https://github.com/informalsystems/hermes-sdk/blob/27168d1ee8c004d87b39d769e80c686d79ed53c5/crates/cosmos/cosmos-chain-components/src/impls/types/config.rs#L21-L22

Can you please take over this PR since I am off sick?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No problem, get some rest. I think this is lower priority for now.

@Farhad-Shabani Farhad-Shabani added this to the MVP Demo #2 milestone Feb 28, 2025
@rnbguy rnbguy requested a review from soareschen March 4, 2025 10:43
@soareschen
Copy link
Collaborator

@rnbguy I have pushed a commit to properly save and load the wallet files using async I/O. Please test it and see if it works.

@rnbguy
Copy link
Member Author

rnbguy commented Mar 4, 2025

thanks @soareschen ! the changes work on testnet 🙏🏼 we can merge.

@soareschen soareschen merged commit 1f68335 into main Mar 4, 2025
9 checks passed
@soareschen soareschen deleted the rano/sn-signing-key-on-diff-file branch March 4, 2025 13:09
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.

exclude Starknet wallet's signing key in relayer config
3 participants