Skip to content

Commit

Permalink
added comments + reordered example config
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtau committed Sep 7, 2021
1 parent 2d7842a commit e07d221
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .changelog/unreleased/features/1267-ethermint-support.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- Added Ethermint support ([#1267] [#1071])
- Added post-Stargate (v0.5+) Ethermint support ([#1267] [#1071])

[#1267]: https://github.com/informalsystems/ibc-rs/issues/1267
[#1071]: https://github.com/informalsystems/ibc-rs/issues/1071
28 changes: 14 additions & 14 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ account_prefix = 'cosmos'
# https://hermes.informal.systems/commands/keys/index.html#adding-keys
key_name = 'testkey'

# Specify the address type which determines:
# 1) address derivation;
# 2) how to retrieve and decode accounts and pubkeys;
# 3) the message signing method.
# The current configuration options are for Cosmos SDK and Ethermint.
#
# Example configuration for Ethermint:
#
# address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } }
#
# Default: { derivation = 'cosmos' }, i.e. address derivation as in Cosmos SDK
# Warning: This is an advanced feature! Modify with caution.
address_type = { derivation = 'cosmos' }

# Specify the store prefix used by the on-chain IBC modules. Required
# Recommended value for Cosmos SDK: 'ibc'
store_prefix = 'ibc'
Expand Down Expand Up @@ -131,20 +145,6 @@ trusting_period = '14days'
# Warning: This is an advanced feature! Modify with caution.
trust_threshold = { numerator = '1', denominator = '3' }

# Specify the address type which determines:
# 1) address derivation;
# 2) how to retrieve and decode accounts and pubkeys;
# 3) the message signing method.
# The current configuration options are for Cosmos SDK and Ethermint.
#
# Example configuration for Ethermint:
#
# address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } }
#
# Default: { derivation = 'cosmos' }, i.e. address derivation as in Cosmos SDK
# Warning: This is an advanced feature! Modify with caution.
address_type = { derivation = 'cosmos' }

# This section specifies the filters for policy based relaying.
# Default: no policy/ filters
# The section is ignored if the global 'filter' option is set to 'false'.
Expand Down
2 changes: 2 additions & 0 deletions proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub mod cosmos {
pub mod v1beta1 {
include!("prost/cosmos.auth.v1beta1.rs");
/// EthAccount defines an Ethermint account.
/// TODO: remove when https://github.com/cosmos/cosmos-sdk/pull/9981
/// lands in the next Cosmos SDK release
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EthAccount {
#[prost(message, optional, tag = "1")]
Expand Down
4 changes: 4 additions & 0 deletions relayer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ impl Default for RestConfig {
}
}

/// It defines the address generation method
/// TODO: Ethermint `pk_type` to be restricted
/// after the Cosmos SDK release with ethsecp256k1
/// https://github.com/cosmos/cosmos-sdk/pull/9981
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[serde(
rename_all = "lowercase",
Expand Down
6 changes: 5 additions & 1 deletion relayer/src/keyring/pub_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ impl FromStr for EncodedPubKey {
);

// Ethermint pubkey types:
// "/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey", "/injective.crypto.v1beta1.ethsecp256k1.PubKey"
// e.g. "/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey", "/injective.crypto.v1beta1.ethsecp256k1.PubKey"
// "/ethermint.crypto.v1beta1.ethsecp256k1.PubKey", "/ethermint.crypto.v1.ethsecp256k1.PubKey",
// "/cosmos.crypto.ethsecp256k1.PubKey"
// TODO: to be restricted after the Cosmos SDK release with ethsecp256k1
// https://github.com/cosmos/cosmos-sdk/pull/9981
if proto.tpe != "/cosmos.crypto.secp256k1.PubKey"
&& !proto.tpe.ends_with(".ethsecp256k1.PubKey")
{
Expand Down

0 comments on commit e07d221

Please sign in to comment.