Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func chainsAddDirCmd(a *appState) *cobra.Command {
Args: withUsage(cobra.ExactArgs(1)),
Short: `Add chain configuration data in bulk from a directory. Example dir: 'configs/demo/chains'`,
Long: `Add chain configuration data in bulk from a directory housing individual chain config files. This is useful for spinning up testnets.

See 'configs/demo/chains' for an example of individual chain config files.`,
Example: strings.TrimSpace(fmt.Sprintf(`
$ %s chains add-dir configs/demo/chains
Expand Down
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
Expand Down
9 changes: 9 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,15 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
Expand Down
27 changes: 27 additions & 0 deletions proto/cosmos/evm/crypto/v1/ethsecp256k1/keys.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

syntax = "proto3";

// buf:lint:ignore PACKAGE_VERSION_SUFFIX
package cosmos.evm.crypto.v1.ethsecp256k1;

import "gogoproto/gogo.proto";

// Originally github.com/cosmos/evm/crypto/ethsecp256k1
option go_package = "github.com/cosmos/relayer/v2/relayer/codecs/evm";

// PubKey defines a type alias for an ecdsa.PublicKey that implements
// Tendermint's PubKey interface. It represents the 33-byte compressed public
// key format.
message PubKey {
option (gogoproto.goproto_stringer) = false;

// key is the public key in byte form
bytes key = 1;
}

// PrivKey defines a type alias for an ecdsa.PrivateKey that implements
// Tendermint's PrivateKey interface.
message PrivKey {
// key is the private key in byte form
bytes key = 1;
}
20 changes: 20 additions & 0 deletions proto/cosmos/evm/types/v1/dynamic_fee.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

syntax = "proto3";
package cosmos.evm.types.v1;

import "amino/amino.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/relayer/v2/relayer/codecs/evm";

// ExtensionOptionDynamicFeeTx is an extension option that specifies the
// maxPrioPrice for cosmos tx
message ExtensionOptionDynamicFeeTx {
// max_priority_price is the same as `max_priority_fee_per_gas` in eip-1559
// spec
string max_priority_price = 1 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}
31 changes: 31 additions & 0 deletions proto/cosmos/evm/types/v1/indexer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

syntax = "proto3";
package cosmos.evm.types.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/relayer/v2/relayer/codecs/evm";

// TxResult is the value stored in eth tx indexer
message TxResult {
option (gogoproto.goproto_getters) = false;

// height of the blockchain
int64 height = 1;
// tx_index of the cosmos transaction
uint32 tx_index = 2;
// msg_index in a batch transaction
uint32 msg_index = 3;

// eth_tx_index is the index in the list of valid eth tx in the block,
// aka. the transaction list returned by eth_getBlock api.
int32 eth_tx_index = 4;
// failed is true if the eth transaction did not go succeed
bool failed = 5;
// gas_used by the transaction. If it exceeds the block gas limit,
// it's set to gas limit, which is what's actually deducted by ante handler.
uint64 gas_used = 6;
// cumulative_gas_used specifies the cumulated amount of gas used for all
// processed messages within the current batch transaction.
uint64 cumulative_gas_used = 7;
}
28 changes: 28 additions & 0 deletions proto/cosmos/evm/types/v1/web3.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

syntax = "proto3";
package cosmos.evm.types.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/relayer/v2/relayer/codecs/evm";

// ExtensionOptionsWeb3Tx is an extension option that specifies the typed chain
// id, the fee payer as well as its signature data.
message ExtensionOptionsWeb3Tx {
option (gogoproto.goproto_getters) = false;

// typed_data_chain_id is used only in EIP712 Domain and should match
// Ethereum network ID in a Web3 provider (e.g. Metamask).
uint64 typed_data_chain_id = 1 [
(gogoproto.jsontag) = "typedDataChainID,omitempty",
(gogoproto.customname) = "TypedDataChainID"
];

// fee_payer is an account address for the fee payer. It will be validated
// during EIP712 signature checking.
string fee_payer = 2 [ (gogoproto.jsontag) = "feePayer,omitempty" ];

// fee_payer_sig is a signature data from the fee paying account,
// allows to perform fee delegation when using EIP712 Domain.
bytes fee_payer_sig = 3 [ (gogoproto.jsontag) = "feePayerSig,omitempty" ];
}
5 changes: 5 additions & 0 deletions relayer/chains/cosmos/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
cosmosmodule "github.com/cosmos/relayer/v2/relayer/chains/cosmos/module"
"github.com/cosmos/relayer/v2/relayer/chains/cosmos/stride"
ethermintcodecs "github.com/cosmos/relayer/v2/relayer/codecs/ethermint"
evmcodecs "github.com/cosmos/relayer/v2/relayer/codecs/evm"
injectivecodecs "github.com/cosmos/relayer/v2/relayer/codecs/injective"
)

Expand Down Expand Up @@ -86,6 +87,10 @@ func MakeCodec(moduleBasics []module.AppModuleBasic, extraCodecs []string, accBe
injectivecodecs.RegisterInterfaces(encodingConfig.InterfaceRegistry)
encodingConfig.Amino.RegisterConcrete(&injectivecodecs.PubKey{}, injectivecodecs.PubKeyName, nil)
encodingConfig.Amino.RegisterConcrete(&injectivecodecs.PrivKey{}, injectivecodecs.PrivKeyName, nil)
case "evm":
evmcodecs.RegisterInterfaces(encodingConfig.InterfaceRegistry)
encodingConfig.Amino.RegisterConcrete(&evmcodecs.PubKey{}, evmcodecs.PubKeyName, nil)
encodingConfig.Amino.RegisterConcrete(&evmcodecs.PrivKey{}, evmcodecs.PrivKeyName, nil)
}
}

Expand Down
4 changes: 4 additions & 0 deletions relayer/chains/cosmos/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/cosmos/go-bip39"
"github.com/cosmos/relayer/v2/relayer/chains/cosmos/keys/sr25519"
"github.com/cosmos/relayer/v2/relayer/codecs/ethermint"
"github.com/cosmos/relayer/v2/relayer/codecs/evm"
"github.com/cosmos/relayer/v2/relayer/codecs/injective"
)

Expand Down Expand Up @@ -116,6 +117,9 @@ func (cc *CosmosProvider) KeyAddOrRestore(keyName string, coinType uint32, signi
if codec == "injective" {
algo = keyring.SignatureAlgo(injective.EthSecp256k1)
}
if codec == "evm" {
algo = keyring.SignatureAlgo(evm.EthSecp256k1)
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion relayer/chains/cosmos/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"
"github.com/cosmos/relayer/v2/cclient"
"github.com/cosmos/relayer/v2/relayer/codecs/ethermint"
"github.com/cosmos/relayer/v2/relayer/codecs/evm"
"github.com/cosmos/relayer/v2/relayer/processor"
"github.com/cosmos/relayer/v2/relayer/provider"
"github.com/strangelove-ventures/cometbft-client/client"
Expand Down Expand Up @@ -109,7 +110,7 @@ func (pc CosmosProviderConfig) NewProvider(log *zap.Logger, homepath string, deb
cp := &CosmosProvider{
log: log,
PCfg: pc,
KeyringOptions: []keyring.Option{ethermint.EthSecp256k1Option()},
KeyringOptions: []keyring.Option{ethermint.EthSecp256k1Option(), evm.EthSecp256k1Option()},
Input: os.Stdin,
Output: os.Stdout,
walletStateMap: map[string]*WalletState{},
Expand Down Expand Up @@ -297,6 +298,7 @@ func (cc *CosmosProvider) Init(ctx context.Context) error {
if err != nil {
return err
}

// TODO: figure out how to deal with input or maybe just make all keyring backends test?

timeout, err := time.ParseDuration(cc.PCfg.Timeout)
Expand Down
5 changes: 5 additions & 0 deletions relayer/chains/penumbra/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
cosmosmodule "github.com/cosmos/relayer/v2/relayer/chains/cosmos/module"
"github.com/cosmos/relayer/v2/relayer/chains/cosmos/stride"
ethermintcodecs "github.com/cosmos/relayer/v2/relayer/codecs/ethermint"
evmcodecs "github.com/cosmos/relayer/v2/relayer/codecs/evm"
injectivecodecs "github.com/cosmos/relayer/v2/relayer/codecs/injective"
)

Expand Down Expand Up @@ -79,6 +80,10 @@ func makeCodec(moduleBasics []module.AppModuleBasic, extraCodecs []string) Codec
injectivecodecs.RegisterInterfaces(encodingConfig.InterfaceRegistry)
encodingConfig.Amino.RegisterConcrete(&injectivecodecs.PubKey{}, injectivecodecs.PubKeyName, nil)
encodingConfig.Amino.RegisterConcrete(&injectivecodecs.PrivKey{}, injectivecodecs.PrivKeyName, nil)
case "evm":
evmcodecs.RegisterInterfaces(encodingConfig.InterfaceRegistry)
encodingConfig.Amino.RegisterConcrete(&evmcodecs.PubKey{}, evmcodecs.PubKeyName, nil)
encodingConfig.Amino.RegisterConcrete(&evmcodecs.PrivKey{}, evmcodecs.PrivKeyName, nil)
}
}

Expand Down
Loading