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

Bridge module #106

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
86d4138
feat: add bridge module
YuexingZeng Jan 16, 2024
89a04a6
feat: add group module dep
YuexingZeng Jan 17, 2024
0ee0625
refa: refa caller and signer struct
YuexingZeng Jan 17, 2024
cb237e0
fix: fix proto
YuexingZeng Jan 17, 2024
c37fd8a
add tx rpc
YuexingZeng Jan 17, 2024
7fb2552
fix: fix proto
YuexingZeng Jan 17, 2024
317ce3b
feat: add module parameters
YuexingZeng Jan 18, 2024
6ff7f08
feat: permission control and sign logic
YuexingZeng Jan 18, 2024
0517fca
refa: refa caller and signer group
YuexingZeng Jan 18, 2024
be7cefc
fix: fix unitest
YuexingZeng Jan 18, 2024
6dcac3f
fix: fix unitest
YuexingZeng Jan 19, 2024
e9fc4cf
unitest: fix unitest
YuexingZeng Jan 19, 2024
4cf4aae
fix: ignore cli unitest
YuexingZeng Jan 19, 2024
7526db3
fix: proto format
YuexingZeng Jan 20, 2024
6d809ca
fix: fix proto lint
YuexingZeng Jan 20, 2024
d195d5b
fix: fix protolint
YuexingZeng Jan 20, 2024
97247ed
refa: refa withdraw struct
YuexingZeng Jan 22, 2024
af0388e
fix: use cosmossdk.io/errors
YuexingZeng Jan 22, 2024
b0cd608
fix: fix golangci-lint
YuexingZeng Jan 24, 2024
880f369
fix: fix shellcheck
YuexingZeng Jan 24, 2024
9223b33
fix: fix shellcheck
YuexingZeng Jan 24, 2024
7d104ca
fix: ignore gitleak in init.bat
YuexingZeng Jan 24, 2024
14867d8
fix: fix gosec check
YuexingZeng Jan 24, 2024
f1e5192
refa: add events and fix genesis-state of groups
YuexingZeng Jan 30, 2024
3cb87ce
fix: fix lint
YuexingZeng Jan 30, 2024
301aab3
refa: refa deposit or withdraw status
YuexingZeng Jan 31, 2024
c35ea18
refa: coin type use enum rather than str
YuexingZeng Feb 4, 2024
a7f9425
refa: use threshold params rather than hard code
YuexingZeng Feb 4, 2024
8bd68f6
fix: fix golangci lint
YuexingZeng Feb 4, 2024
feeb97d
fix: fix golangci-lint and gosec lint
YuexingZeng Feb 4, 2024
105baba
fix: fix gosec lint
YuexingZeng Feb 4, 2024
d334592
refa: update deposit add rollup_tx_hash and aa_address
YuexingZeng Feb 5, 2024
123b94b
feat: get withdraw records by status
YuexingZeng Feb 5, 2024
05c20f1
fix lint
YuexingZeng Feb 5, 2024
f3ec638
refa: value field use int64 rather than uint64
YuexingZeng Feb 6, 2024
d56d6be
refa: refa withdraw record structure
YuexingZeng Feb 6, 2024
7e77da9
fix: fix gonglangci-lint
YuexingZeng Feb 6, 2024
47257b7
feat: add rollup_tx object
YuexingZeng Feb 21, 2024
00b820a
feat: save rollup_tx on chain
YuexingZeng Feb 21, 2024
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
3 changes: 2 additions & 1 deletion .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ paths = [
'''(go.mod|go.sum)$''',
'''node_modules''',
'''vendor''',
'''init.sh'''
'''init.sh''',
'''init.bat'''
]

[[rules]]
Expand Down
46 changes: 44 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import (
"os"
"path/filepath"

"github.com/cosmos/cosmos-sdk/x/group"
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
bridgemoduletypes "github.com/evmos/ethermint/x/bridge/types"

"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
Expand Down Expand Up @@ -122,6 +127,8 @@ import (
"github.com/evmos/ethermint/ethereum/eip712"
srvflags "github.com/evmos/ethermint/server/flags"
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/bridge"
bridgemodulekeeper "github.com/evmos/ethermint/x/bridge/keeper"
"github.com/evmos/ethermint/x/evm"
evmkeeper "github.com/evmos/ethermint/x/evm/keeper"
evmtypes "github.com/evmos/ethermint/x/evm/types"
Expand Down Expand Up @@ -171,13 +178,15 @@ var (
ibc.AppModuleBasic{},
authzmodule.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
groupmodule.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
// Ethermint modules
evm.AppModuleBasic{},
feemarket.AppModuleBasic{},
bridge.AppModuleBasic{},
)

// module account permissions
Expand Down Expand Up @@ -230,6 +239,7 @@ type EthermintApp struct {
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
GroupKeeper groupkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
EvidenceKeeper evidencekeeper.Keeper
Expand All @@ -242,6 +252,7 @@ type EthermintApp struct {
// Ethermint keepers
EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
BridgeKeeper bridgemodulekeeper.Keeper

// the module manager
mm *module.Manager
Expand Down Expand Up @@ -289,9 +300,9 @@ func NewEthermintApp(
evidencetypes.StoreKey, capabilitytypes.StoreKey,
feegrant.StoreKey, authzkeeper.StoreKey,
// ibc keys
ibchost.StoreKey, ibctransfertypes.StoreKey,
ibchost.StoreKey, ibctransfertypes.StoreKey, group.StoreKey,
// ethermint keys
evmtypes.StoreKey, feemarkettypes.StoreKey,
evmtypes.StoreKey, feemarkettypes.StoreKey, bridgemoduletypes.StoreKey,
)

// Add the EVM transient store key
Expand Down Expand Up @@ -369,6 +380,18 @@ func NewEthermintApp(
&stakingKeeper,
authtypes.FeeCollectorName,
)
groupConfig := group.DefaultConfig()
/*
Example of setting group params:
groupConfig.MaxMetadataLen = 1000
*/
app.GroupKeeper = groupkeeper.NewKeeper(
keys[group.StoreKey],
appCodec,
app.MsgServiceRouter(),
app.AccountKeeper,
groupConfig,
)
app.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec,
keys[slashingtypes.StoreKey],
Expand Down Expand Up @@ -453,6 +476,16 @@ func NewEthermintApp(
),
)

app.BridgeKeeper = *bridgemodulekeeper.NewKeeper(
appCodec,
keys[bridgemoduletypes.StoreKey],
keys[bridgemoduletypes.MemStoreKey],
app.GetSubspace(bridgemoduletypes.ModuleName),

app.GroupKeeper,
)
bridgeModule := bridge.NewAppModule(appCodec, app.BridgeKeeper, app.AccountKeeper, app.BankKeeper)

// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName),
Expand Down Expand Up @@ -493,6 +526,7 @@ func NewEthermintApp(
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil),
Expand All @@ -510,6 +544,7 @@ func NewEthermintApp(
// Ethermint app modules
feemarket.NewAppModule(app.FeeMarketKeeper, feeMarketSs),
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper, evmSs),
bridgeModule,
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand Down Expand Up @@ -538,8 +573,10 @@ func NewEthermintApp(
genutiltypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
group.ModuleName,
paramstypes.ModuleName,
vestingtypes.ModuleName,
bridgemoduletypes.ModuleName,
)

// NOTE: fee market module must go last in order to retrieve the block gas used.
Expand All @@ -562,9 +599,11 @@ func NewEthermintApp(
evidencetypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
group.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
vestingtypes.ModuleName,
bridgemoduletypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -594,11 +633,13 @@ func NewEthermintApp(
ibctransfertypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
group.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
vestingtypes.ModuleName,
// NOTE: crisis module must go at the end to check for invariants on each module
crisistypes.ModuleName,
bridgemoduletypes.ModuleName,
)

// Uncomment if you want to set a custom migration order here.
Expand Down Expand Up @@ -868,5 +909,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
// ethermint subspaces
paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint: staticcheck
paramsKeeper.Subspace(feemarkettypes.ModuleName).WithKeyTable(feemarkettypes.ParamKeyTable())
paramsKeeper.Subspace(bridgemoduletypes.ModuleName)
return paramsKeeper
}
6 changes: 5 additions & 1 deletion init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ del /s /q %HOME%
ethermintd config keyring-backend %KEYRING%
ethermintd config chain-id %CHAINID%

ethermintd keys add %KEY% --keyring-backend %KEYRING% --algo %KEYALGO%
for /f "delims=" %%a in ('ethermintd keys add %KEY% --keyring-backend %KEYRING% --algo %KEYALGO% --output json ^| jq -r ".address"') do (
set ACCOUNT_ADDRESS=%%a
)

rem Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
ethermintd init %MONIKER% --chain-id %CHAINID%
Expand All @@ -43,6 +45,8 @@ cat %GENESIS% | jq ".app_state[\"staking\"][\"params\"][\"bond_denom\"]=\"aphoto
cat %GENESIS% | jq ".app_state[\"crisis\"][\"constant_fee\"][\"denom\"]=\"aphoton\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"gov\"][\"deposit_params\"][\"min_deposit\"][0][\"denom\"]=\"aphoton\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"mint\"][\"params\"][\"mint_denom\"]=\"aphoton\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"bridge\"][\"callerGroupList\"]=[{\"name\":\"caller group\",\"admin\":\"%ACCOUNT_ADDRESS%\",\"members\":[\"%ACCOUNT_ADDRESS%\"],\"creator\":\"%ACCOUNT_ADDRESS%\",}]" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
cat %GENESIS% | jq ".app_state[\"bridge\"][\"signerGroupList\"]=[{\"name\":\"signer group\",\"admin\":\"%ACCOUNT_ADDRESS%\",\"members\":[\"%ACCOUNT_ADDRESS%\"],\"creator\":\"%ACCOUNT_ADDRESS%\",}]" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%

rem increase block time (?)
cat %GENESIS% | jq ".consensus_params[\"block\"][\"time_iota_ms\"]=\"30000\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS%
Expand Down
68 changes: 35 additions & 33 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@ ethermintd config keyring-backend $KEYRING
ethermintd config chain-id $CHAINID

# if $KEY exists it should be deleted
ethermintd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
OUTPUT=$(ethermintd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --output json)
ACCOUNT_ADDRESS=$(echo "$OUTPUT" | jq -r '.address')

# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
ethermintd init $MONIKER --chain-id $CHAINID

# Change parameter token denominations to aphoton
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json
cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json

jq '.app_state["staking"]["params"]["bond_denom"]="aphoton"' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json
jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json
jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json
jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json
jq --arg ADDRESS "$ACCOUNT_ADDRESS" '.app_state["bridge"]["callerGroupList"]=[{"name":"caller group","admin":$ADDRESS,"members":[$ADDRESS],"creator":$ADDRESS}]' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json
jq --arg ADDRESS "$ACCOUNT_ADDRESS" '.app_state["bridge"]["signerGroupList"]=[{"name":"signer group","admin":$ADDRESS,"members":[$ADDRESS],"creator":$ADDRESS}]' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json
# Set gas limit in genesis
cat $HOME/.ethermintd/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="20000000"' > $HOME/.ethermintd/config/tmp_genesis.json && mv $HOME/.ethermintd/config/tmp_genesis.json $HOME/.ethermintd/config/genesis.json
jq '.consensus_params["block"]["max_gas"]="20000000"' "$HOME"/.ethermintd/config/genesis.json > "$HOME"/.ethermintd/config/tmp_genesis.json && mv "$HOME"/.ethermintd/config/tmp_genesis.json "$HOME"/.ethermintd/config/genesis.json

# Allocate genesis accounts (cosmos formatted addresses)
ethermintd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
Expand All @@ -50,39 +52,39 @@ ethermintd validate-genesis

# disable produce empty block and enable prometheus metrics
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/prometheus = false/prometheus = true/' $HOME/.ethermintd/config/config.toml
sed -i '' 's/prometheus-retention-time = 0/prometheus-retention-time = 1000000000000/g' $HOME/.ethermintd/config/app.toml
sed -i '' 's/enabled = false/enabled = true/g' $HOME/.ethermintd/config/app.toml
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/prometheus = false/prometheus = true/' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/prometheus-retention-time = 0/prometheus-retention-time = 1000000000000/g' "$HOME"/.ethermintd/config/app.toml
sed -i '' 's/enabled = false/enabled = true/g' "$HOME"/.ethermintd/config/app.toml
else
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.ethermintd/config/config.toml
sed -i 's/prometheus = false/prometheus = true/' $HOME/.ethermintd/config/config.toml
sed -i 's/prometheus-retention-time = "0"/prometheus-retention-time = "1000000000000"/g' $HOME/.ethermintd/config/app.toml
sed -i 's/enabled = false/enabled = true/g' $HOME/.ethermintd/config/app.toml
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/prometheus = false/prometheus = true/' "$HOME"/.ethermintd/config/config.toml
sed -i 's/prometheus-retention-time = "0"/prometheus-retention-time = "1000000000000"/g' "$HOME"/.ethermintd/config/app.toml
sed -i 's/enabled = false/enabled = true/g' "$HOME"/.ethermintd/config/app.toml
fi

if [[ $1 == "pending" ]]; then
echo "pending mode is on, please wait for the first block committed."
if [[ $OSTYPE == "darwin"* ]]; then
sed -i '' 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.ethermintd/config/config.toml
sed -i '' 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' "$HOME"/.ethermintd/config/config.toml
else
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.ethermintd/config/config.toml
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' "$HOME"/.ethermintd/config/config.toml
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' "$HOME"/.ethermintd/config/config.toml
fi
fi

Expand Down
16 changes: 16 additions & 0 deletions proto/ethermint/bridge/v1/caller_group.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";
package ethermint.bridge.v1;

option go_package = "github.com/evmos/ethermint/x/bridge/types";

// CallerGroup defines an account address group with the required permissions of the bridge operation.
message CallerGroup {
// name is a unique identifier for the group.
string name = 1;
// admin is the account address with the right to add/remove members.
string admin = 2;
// members are the accounts with the right to perform the bridge operation.
repeated string members = 3;
// creator is the sender of message.
string creator = 4;
}
45 changes: 45 additions & 0 deletions proto/ethermint/bridge/v1/deposit.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
syntax = "proto3";
package ethermint.bridge.v1;

option go_package = "github.com/evmos/ethermint/x/bridge/types";

// Deposit represents a record of deposit operation.
message Deposit {
// tx_hash is the transaction hash of the deposit.
string tx_hash = 1;
// from is the sender address of the deposit.
string from = 2;
// to is the recipient address on the destination chain.
string to = 3;
// coin_type is the coin being deposited.
CoinType coin_type = 4;
// value is the amount of coins being deposited.
uint64 value = 5;
// data is the tx data of the deposit.
string data = 6;
// status is the status of the deposit record.
// status can be: Pending, Completed, Failed.
DepositStatus status = 7;
// creator is the sender of message.
string creator = 8;
}

// DepositStatus represents the status of a deposit record.
enum DepositStatus {
// DEPOSIT_STATUS_UNSPECIFIED represents an unspecified status.
DEPOSIT_STATUS_UNSPECIFIED = 0;
// DEPOSIT_STATUS_PENDING represents a deposit record that is pending.
DEPOSIT_STATUS_PENDING = 1;
// DEPOSIT_STATUS_COMPLETED represents a deposit record that has been processed and completed.
DEPOSIT_STATUS_COMPLETED = 2;
// DEPOSIT_STATUS_FAILED represents a deposit record that has been processed and failed.
DEPOSIT_STATUS_FAILED = 3;
}

// CoinType represents the type of a coin.
enum CoinType {
// COIN_TYPE_UNSPECIFIED represents an unspecified coin type.
COIN_TYPE_UNSPECIFIED = 0;
// COIN_TYPE_BTC represents the Bitcoin coin type.
COIN_TYPE_BTC = 1;
}
Loading
Loading