Skip to content

Commit

Permalink
Merge branch 'main' into loredana/fee-distribution
Browse files Browse the repository at this point in the history
* main:
  update testnet docs (evmos#465)
  [ENG-128] Fee distribution - fees v1 proto and types (evmos#461)
  build(deps): bump codecov/codecov-action from 2.1.0 to 3 (evmos#463)
  • Loading branch information
loredanacirstea committed Apr 6, 2022
2 parents c6ba1ba + a81fd31 commit a5df22b
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: |
make test-unit-cover
if: env.GIT_DIFF
- uses: codecov/codecov-action@v2.1.0
- uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ module.exports = {
rpc_url_local: 'http://localhost:8545/',
chain_id: '9001',
testnet_chain_id: '9000',
latest_version: 'v3.0.0-beta',
latest_version: 'v3.0.0-beta1',
version_number: '2',
testnet_version_number: '3',
testnet_version_number: '4',
testnet_evm_explorer_url: 'https://evm.evmos.dev',
evm_explorer_url: 'https://evm.evmos.org',
testnet_cosmos_explorer_url: 'https://explorer.evmos.dev/',
Expand Down
15 changes: 8 additions & 7 deletions docs/basics/chain_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ Learn about the Evmos chain-id format {synopsis}
:::: tabs
::: tab Mainnet

| Name | Chain ID | Identifier | EIP155 Number | Version Number |
|-------------------------------------------------|-----------------------------------------------|------------|---------------------------------------|-------------------------------------------|
| Name | Chain ID | Identifier | EIP155 Number | Version Number |
| ----------------------------------------------- | --------------------------------------------- | ---------- | ------------------------------------- | ------------------------------------------- |
| Evmos {{ $themeConfig.project.version_number }} | `evmos_{{ $themeConfig.project.chain_id }}-2` | `evmos` | `{{ $themeConfig.project.chain_id }}` | `{{ $themeConfig.project.version_number }}` |
| Evmos 1 | `evmos_{{ $themeConfig.project.chain_id }}-1` | `evmos` | `{{ $themeConfig.project.chain_id }}` | `1` |
| Evmos 1 | `evmos_{{ $themeConfig.project.chain_id }}-1` | `evmos` | `{{ $themeConfig.project.chain_id }}` | `1` |
:::
::: tab Testnets

| Name | Chain ID | Identifier | EIP155 Number | Version Number |
|-----------------------------------|-------------------------------------------------------|------------|-----------------------------------------------|-----------------------------------------------------|
| Evmos Public Testnet | `evmos_{{ $themeConfig.project.testnet_chain_id }}-3` | `evmos` | `{{ $themeConfig.project.testnet_chain_id }}` | `{{ $themeConfig.project.testnet_version_number }}` |
| Olympus Mons Incentivized Testnet | `evmos_{{ $themeConfig.project.testnet_chain_id }}-2` | `evmos` | `{{ $themeConfig.project.testnet_chain_id }}` | `2` |
| --------------------------------- | ----------------------------------------------------- | ---------- | --------------------------------------------- | --------------------------------------------------- |
| Evmos Public Testnet | `evmos_{{ $themeConfig.project.testnet_chain_id }}-4` | `evmos` | `{{ $themeConfig.project.testnet_chain_id }}` | `{{ $themeConfig.project.testnet_version_number }}` |
| Evmos Public Testnet | `evmos_{{ $themeConfig.project.testnet_chain_id }}-3` | `evmos` | `{{ $themeConfig.project.testnet_chain_id }}` | `3` |
| Olympus Mons Incentivized Testnet | `evmos_{{ $themeConfig.project.testnet_chain_id }}-2` | `evmos` | `{{ $themeConfig.project.testnet_chain_id }}` | `2` |
| Arsia Mons Testnet | `evmos_{{ $themeConfig.project.testnet_chain_id }}-1` | `evmos` | `{{ $themeConfig.project.testnet_chain_id }}` | `1` |

:::
Expand Down Expand Up @@ -62,7 +63,7 @@ The format for specifying and Evmos compatible chain-id in genesis is the follow
The following table provides an example where the second row corresponds to an upgrade from the first one:

| ChainID | Identifier | EIP155 Number | Version Number |
|----------------|------------|---------------|----------------|
| -------------- | ---------- | ------------- | -------------- |
| `evmos_9000-1` | evmos | 9000 | 1 |
| `evmos_9000-2` | evmos | 9000 | 2 |
| `...` | ... | ... | ... |
Expand Down
2 changes: 1 addition & 1 deletion docs/governance/submitting.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Use the `evmos tx gov --help` flag to get more info about the governance command
- many nodes (including the Figment node) use a minimum fee to desincentivize transaction spamming
- 7500aevmos is equal to 0.0075 EVMOS
6. `--chain-id evmos_90001-2` is Evmos Mainnet. For current and past chain-id's, please look at the [tharsis/mainnet resource](https://github.com/tharsis/mainnet)
- the testnet chain ID is [evmos_9000-3](https://testnet.mintscan.io/evmos). For current and past testnet information, please look at the [testnet repository](https://github.com/tharsis/testnets)
- the testnet chain ID is [evmos_9000-4](https://testnet.mintscan.io/evmos). For current and past testnet information, please look at the [testnet repository](https://github.com/tharsis/testnets)
7. `--node` is using a full node to send the transaction to the Evmos Mainnet

### Verifying your transaction
Expand Down
12 changes: 6 additions & 6 deletions docs/guides/keys-wallets/multisig.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ evmosd tx bank send \
test1 \
evmos1e0fx0q9meawrcq7fmma9x60gk35lpr4xk3884m \
10000000000000000000aevmos \
--chain-id=evmos_9000-3 \
--chain-id=evmos_9000-4 \
--gas=auto \
--fees=1000000aevmos \
--broadcast-mode=block
Expand All @@ -97,7 +97,7 @@ evmosd tx bank send \
5000000000000000000aevmos \
--gas=200000 \
--fees=1000000aevmos \
--chain-id=evmos_9000-3 \
--chain-id=evmos_9000-4 \
--generate-only > unsignedTx.json
```

Expand Down Expand Up @@ -152,7 +152,7 @@ evmosd tx sign \
--multisig=evmos1e0fx0q9meawrcq7fmma9x60gk35lpr4xk3884m \
--from=test1 \
--output-document=test1sig.json \
--chain-id=evmos_9000-3
--chain-id=evmos_9000-4
```

```sh
Expand All @@ -161,7 +161,7 @@ evmosd tx sign \
--multisig=evmos1e0fx0q9meawrcq7fmma9x60gk35lpr4xk3884m \
--from=test2 \
--output-document=test2sig.json \
--chain-id=evmos_9000-3
--chain-id=evmos_9000-4
```

### Step 4: Create multisignature
Expand All @@ -174,7 +174,7 @@ evmosd tx multisign \
multi \
test1sig.json test2sig.json \
--output-document=signedTx.json \
--chain-id=evmos_9000-3
--chain-id=evmos_9000-4
```

The TX is now signed:
Expand Down Expand Up @@ -266,6 +266,6 @@ The TX is now signed:

```sh
evmosd tx broadcast signedTx.json \
--chain-id=evmos_9000-3 \
--chain-id=evmos_9000-4 \
--broadcast-mode=block
```
4 changes: 2 additions & 2 deletions docs/guides/localnet/single_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can customize the local testnet script by changing values for convenience fo
```bash
# customize the name of your key, the chain-id, moniker of the node, keyring backend, and log level
KEY="mykey"
CHAINID="evmos_9000-3"
CHAINID="evmos_9000-4"
MONIKER="localtestnet"
KEYRING="test"
LOGLEVEL="info"
Expand Down Expand Up @@ -48,7 +48,7 @@ Before actually running the node, we need to initialize the chain, and most impo
```bash
$MONIKER=testing
$KEY=mykey
$CHAINID="evmos_9000-3"
$CHAINID="evmos_9000-4"

# The argument $MONIKER is the custom username of your node, it should be human-readable.
evmosd init $MONIKER --chain-id=$CHAINID
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/validators/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ evmosd tx staking create-validator
--commission-max-change-rate="0.01"
--min-self-delegation "1"
--moniker "validator"
--chain-id "evmos_9000-3"
--chain-id "evmos_9000-4"
--gas auto
--node tcp://127.0.0.1:26647
```
Expand Down
8 changes: 4 additions & 4 deletions docs/quickstart/binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ evmosd config

We can make changes to the default settings upon our choices, so it allows users to set the configuration beforehand all at once, so it would be ready with the same config afterward.

For example, the chain identifier can be changed to `evmos_9000-3` from a blank name by using:
For example, the chain identifier can be changed to `evmos_9000-4` from a blank name by using:

```bash
evmosd config "chain-id" evmos_9000-3
evmosd config "chain-id" evmos_9000-4
evmosd config
{
"chain-id": "evmos_9000-3",
"chain-id": "evmos_9000-4",
"keyring-backend": "os",
"output": "text",
"node": "tcp://localhost:26657",
Expand All @@ -135,7 +135,7 @@ Alternatively, we can directly make the changes to the config values in one plac

# The network chain ID

chain-id = "evmos_9000-3"
chain-id = "evmos_9000-4"

# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)

Expand Down
10 changes: 5 additions & 5 deletions docs/quickstart/interact_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ There are multiple ways to interact with a node: using the CLI, using gRPC or us
Now that your very own node is running, it is time to try sending tokens from the first account you created to a second account. In a new terminal window, start by running the following query command:

```bash
evmosd query bank balances $MY_VALIDATOR_ADDRESS --chain-id=evmos_9000-3
evmosd query bank balances $MY_VALIDATOR_ADDRESS --chain-id=evmos_9000-4
```

You should see the current balance of the account you created, equal to the original balance of tokens you granted it minus the amount you delegated via the `gentx`. Now, create a second account:
Expand All @@ -26,19 +26,19 @@ RECIPIENT=$(evmosd keys show recipient -a --keyring-backend=file)
The command above creates a local key-pair that is not yet registered on the chain. An account is created the first time it receives tokens from another account. Now, run the following command to send tokens to the `recipient` account:

```bash
evmosd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000000aevmos --chain-id=evmos_9000-3 --keyring-backend=file
evmosd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000000aevmos --chain-id=evmos_9000-4 --keyring-backend=file

# Check that the recipient account did receive the tokens.
evmosd query bank balances $RECIPIENT --chain-id=evmos_9000-3
evmosd query bank balances $RECIPIENT --chain-id=evmos_9000-4
```

Finally, delegate some of the stake tokens sent to the `recipient` account to the validator:

```bash
evmosd tx staking delegate $(evmosd keys show my_validator --bech val -a --keyring-backend=file) 500aevmos --from=recipient --chain-id=evmos_9000-3 --keyring-backend=file
evmosd tx staking delegate $(evmosd keys show my_validator --bech val -a --keyring-backend=file) 500aevmos --from=recipient --chain-id=evmos_9000-4 --keyring-backend=file

# Query the total delegations to `validator`.
evmosd query staking delegations-to $(evmosd keys show my_validator --bech val -a --keyring-backend=file) --chain-id=evmos_9000-3
evmosd query staking delegations-to $(evmosd keys show my_validator --bech val -a --keyring-backend=file) --chain-id=evmos_9000-4
```

You should see two delegations, the first one made from the `gentx`, and the second one you just performed from the `recipient` account.
Expand Down
15 changes: 8 additions & 7 deletions docs/testnet/join.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ You specify the network you want to join by setting the **genesis file** and **s

| Testnet Chain ID | Description | Site | Version | Status |
| ---------------- | --------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------- | --- |
| `evmos_9000-3` | Evmos_9000-3 Testnet | [Evmos 9000-3](https://github.com/tharsis/testnets/tree/main/evmos_9000-3) | [`v3.0.0-beta`](https://github.com/tharsis/evmos/releases/tag/v3.0.0-beta) | `Live` |
| `evmos_9000-4` | Evmos_9000-4 Testnet | [Evmos 9000-4](https://github.com/tharsis/testnets/tree/main/evmos_9000-4) | [`v3.0.0-beta1`](https://github.com/tharsis/evmos/releases/tag/v3.0.0-beta1) | `Live` |
| `evmos_9000-3` | Evmos_9000-3 Testnet | [Evmos 9000-3](https://github.com/tharsis/testnets/tree/main/evmos_9000-3) | [`v1.0.0-beta1`](https://github.com/tharsis/evmos/releases/tag/v1.0.0-beta1) | `Stale` |
| `evmos_9000-2` | Olympus Mons Incentivized Testnet | [Olympus Mons](https://github.com/tharsis/testnets/tree/main/olympus_mons) | [`v0.3.x`](https://github.com/tharsis/evmos/releases) | `Stale` |
| `evmos_9000-1` | Arsia Mons Testnet | [Arsia Mons](https://github.com/tharsis/testnets/tree/main/arsia_mons) | [`v0.1.x`](https://github.com/tharsis/evmos/releases) | `Stale` |

Expand All @@ -26,22 +27,22 @@ Make sure you have the right version of `{{ $themeConfig.project.binary }}` inst

### Save Chain ID

We recommend saving the testnet `chain-id` into your `{{ $themeConfig.project.binary }}`'s `client.toml`. This will make it so you do not have to manually pass in the `chain-id` flag for every CLI command.
We recommend saving the testnet `chain-id` into your `{{ $themeConfig.project.binary }}`'s `client.toml`. This will make it so you do not have to manually pass in the `chain-id` flag for every CLI command.

::: tip
See the Official [Chain IDs](./../basics/chain_id.md#official-chain-ids) for reference.
:::

```bash
evmosd config chain-id evmos_9000-3
evmosd config chain-id evmos_9000-4
```

## Initialize Node

We need to initialize the node to create all the necessary validator and node configuration files:

```bash
evmosd init <your_custom_moniker> --chain-id evmos_9000-3
evmosd init <your_custom_moniker> --chain-id evmos_9000-4
```

::: danger
Expand All @@ -59,7 +60,7 @@ Check the `genesis.json` file from the [`testnets`](https://github.com/tharsis/t

```bash
sudo apt install -y unzip wget
wget -P ~/.evmosd/config https://github.com/tharsis/testnets/raw/main/evmos_9000-3/genesis.zip
wget -P ~/.evmosd/config https://github.com/tharsis/testnets/raw/main/evmos_9000-4/genesis.zip
cd ~/.evmosd/config
unzip genesis.zip
rm genesis.zip
Expand Down Expand Up @@ -92,7 +93,7 @@ seeds = "<node-id>@<ip>:<p2p port>"
You can use the following code to get seeds from the repo and add it to your config:

```bash
SEEDS=`curl -sL https://raw.githubusercontent.com/tharsis/testnets/main/evmos_9000-3/seeds.txt | awk '{print $1}' | paste -s -d, -`
SEEDS=`curl -sL https://raw.githubusercontent.com/tharsis/testnets/main/evmos_9000-4/seeds.txt | awk '{print $1}' | paste -s -d, -`
sed -i.bak -e "s/^seeds =.*/seeds = \"$SEEDS\"/" ~/.evmosd/config/config.toml
```

Expand All @@ -108,7 +109,7 @@ available peers on the [`testnets`](https://github.com/tharsis/testnets) repo.
A list of available persistent peers is also available in the `#find-peers` channel in the [Evmos Discord](https://discord.gg/evmos). You can get a random 10 entries from the `peers.txt` file in the `PEERS` variable by running the following command:

```bash
PEERS=`curl -sL https://raw.githubusercontent.com/tharsis/testnets/main/evmos_9000-3/peers.txt | sort -R | head -n 10 | awk '{print $1}' | paste -s -d, -`
PEERS=`curl -sL https://raw.githubusercontent.com/tharsis/testnets/main/evmos_9000-4/peers.txt | sort -R | head -n 10 | awk '{print $1}' | paste -s -d, -`
```

Use `sed` to include them into the configuration. You can also add them manually:
Expand Down
4 changes: 1 addition & 3 deletions proto/evmos/fees/v1/fees.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ message DevFeeInfo {

// DevFeeInfosPerDeployer defines an instance that keeps track of all
// contracts registered by a deployer
message DevFeeInfosPerDeployer {
repeated string contract_addresses = 1;
}
message DevFeeInfosPerDeployer { repeated string contract_addresses = 1; }
6 changes: 2 additions & 4 deletions proto/evmos/fees/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ option go_package = "github.com/tharsis/evmos/v3/x/fees/types";
// Query defines the gRPC querier service.
service Query {
// DevFeeInfos retrieves all registered contracts for fee distribution
rpc DevFeeInfos(QueryDevFeeInfosRequest)
returns (QueryDevFeeInfosResponse) {
rpc DevFeeInfos(QueryDevFeeInfosRequest) returns (QueryDevFeeInfosResponse) {
option (google.api.http).get = "/evmos/fees/v1/fees";
}

// DevFeeInfo retrieves a registered contract for fee distribution
rpc DevFeeInfo(QueryDevFeeInfoRequest)
returns (QueryDevFeeInfoResponse) {
rpc DevFeeInfo(QueryDevFeeInfoRequest) returns (QueryDevFeeInfoResponse) {
option (google.api.http).get = "/evmos/fees/v1/fees/{contract_address}";
}

Expand Down
9 changes: 5 additions & 4 deletions proto/evmos/fees/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ service Msg {
// receiving transaction fees
rpc RegisterDevFeeInfo(MsgRegisterDevFeeInfo)
returns (MsgRegisterDevFeeInfoResponse) {
option (google.api.http).get = "/evmos/fees/v1/tx/register_fee_contract";
option (google.api.http).post = "/evmos/fees/v1/tx/register_fee_contract";
};
// CancelDevFeeInfo is used by a deployer to cancel a registered contract
// and stop receiving transaction fees
rpc CancelDevFeeInfo(MsgCancelDevFeeInfo)
returns (MsgCancelDevFeeInfoResponse) {
option (google.api.http).get = "/evmos/fees/v1/tx/cancel_fee_contract";
option (google.api.http).post = "/evmos/fees/v1/tx/cancel_fee_contract";
};
// UpdateDevFeeInfo is used by a deployer to update the withdraw address
rpc UpdateDevFeeInfo(MsgUpdateDevFeeInfo)
returns (MsgUpdateDevFeeInfoResponse) {
option (google.api.http).get = "/evmos/fees/v1/tx/update_fee_contract";
option (google.api.http).post = "/evmos/fees/v1/tx/update_fee_contract";
};
}

Expand All @@ -38,7 +38,8 @@ message MsgRegisterDevFeeInfo {
// bech32 address of account receiving the transaction fees
string withdraw_address = 3;
// array of nonces from the address path, where the last nonce is
// the nonce that determines the contract's address - it can be an EOA nonce or a factory contract nonce
// the nonce that determines the contract's address - it can be an EOA nonce
// or a factory contract nonce
repeated uint64 nonces = 4;
}

Expand Down
1 change: 0 additions & 1 deletion x/fees/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
)

// ModuleCdc references the global fees module codec. Note, the codec
Expand Down
2 changes: 1 addition & 1 deletion x/fees/types/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// NewFee returns an instance of DevFeeInfo
func NewDevFeeInfo(
contract common.Address,
owner sdk.AccAddress,
owner,
withdraw sdk.AccAddress,
) DevFeeInfo {
return DevFeeInfo{
Expand Down
1 change: 0 additions & 1 deletion x/fees/types/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
// AccountKeeper defines the expected interface needed to retrieve account info.
type AccountKeeper interface {
GetModuleAddress(moduleName string) sdk.AccAddress
// GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)
}

// BankKeeper defines the expected interface needed to retrieve account balances.
Expand Down
2 changes: 1 addition & 1 deletion x/fees/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func ParamKeyTable() paramtypes.KeyTable {
// NewParams creates a new Params object
func NewParams(
enableFees bool,
developerShares sdk.Dec,
developerShares,
validatorShares sdk.Dec,

) Params {
Expand Down
3 changes: 2 additions & 1 deletion x/fees/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5df22b

Please sign in to comment.