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

refactor: authorizations table #2114

Closed
wants to merge 24 commits into from
Closed
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
12 changes: 10 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

## Unreleased
### Breaking Changes
* Observer param `ballot_maturity_blocks` is part of `emissions` module now. Observer `params` are deprecated and removed from `observer` module.
* `MsgUpdateVerificationFlags` has been removed, and replaced with `MsgEnableHeaderVerification` and `MsgDisableHeaderVerification` messages.
* `MsgEnableHeaderVerification` message enables block header verification for a list of chains and can be triggered via `PolicyType_groupOperational`
* `MsgDisableHeaderVerification` message disables block header verification for a list of chains and can be triggered via `PolicyType_emergency`
* Observer param `ballot_maturity_blocks` is part of `emissions` module now. Observer `params` are deprecated and removed from `observer` module.
* `MsgDisableHeaderVerification` message disables block header verification for a list of chains and can be triggered via `PolicyType_groupEmergency`
* `MsgUpdateZRC20` has been removed, and replaced with `MsgPauseZRC20` and `MsgUnpauseZRC20` messages.
* `MsgPauseZRC20` message pauses a ZRC20 token and can be triggered via `PolicyType_groupEmergency`
* `MsgUnpauseZRC20` message unpauses a ZRC20 token and can be triggered via `PolicyType_groupOperational`
* `MsgUpdateCrosschainFlags` has been removed, and replaced with `MsgEnableCrosschainFlags` ,`MsgDisableCrosschainFlags` and `MsgUpdateGasPriceIncreaseFlags` messages.
* `MsgEnableCrosschainFlags` message enables crosschain flags for a list of chains and can be triggered via `PolicyType_groupOperational`
* `MsgDisableCrosschainFlags` message disables crosschain flags for a list of chains and can be triggered via `PolicyType_groupEmergency`
* `MsgUpdateGasPriceIncreaseFlags` message updates the gas price increase flags for a list of chains and can be triggered via `PolicyType_groupOperational`

### Features

Expand All @@ -23,6 +30,7 @@
* [2097](https://github.com/zeta-chain/node/pull/2097) - refactor lightclient verification flags to account for individual chains
* [2071](https://github.com/zeta-chain/node/pull/2071) - Modify chains struct to add all chain related information
* [2124](https://github.com/zeta-chain/node/pull/2124) - removed unused variables and method
* [2114](https://github.com/zeta-chain/node/pull/2114) - refactor zetacore to create a authorizations table

### Tests

Expand Down
3 changes: 2 additions & 1 deletion docs/cli/zetacored/zetacored_tx_fungible.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ zetacored tx fungible [flags]
* [zetacored tx](zetacored_tx.md) - Transactions subcommands
* [zetacored tx fungible deploy-fungible-coin-zrc-4](zetacored_tx_fungible_deploy-fungible-coin-zrc-4.md) - Broadcast message DeployFungibleCoinZRC20
* [zetacored tx fungible deploy-system-contracts](zetacored_tx_fungible_deploy-system-contracts.md) - Broadcast message SystemContracts
* [zetacored tx fungible pause-zrc20](zetacored_tx_fungible_pause-zrc20.md) - Broadcast message PauseZRC20
* [zetacored tx fungible remove-foreign-coin](zetacored_tx_fungible_remove-foreign-coin.md) - Broadcast message RemoveForeignCoin
* [zetacored tx fungible unpause-zrc20](zetacored_tx_fungible_unpause-zrc20.md) - Broadcast message UnpauseZRC20
* [zetacored tx fungible update-contract-bytecode](zetacored_tx_fungible_update-contract-bytecode.md) - Broadcast message UpdateContractBytecode
* [zetacored tx fungible update-system-contract](zetacored_tx_fungible_update-system-contract.md) - Broadcast message UpdateSystemContract
* [zetacored tx fungible update-zrc20-liquidity-cap](zetacored_tx_fungible_update-zrc20-liquidity-cap.md) - Broadcast message UpdateZRC20LiquidityCap
* [zetacored tx fungible update-zrc20-paused-status](zetacored_tx_fungible_update-zrc20-paused-status.md) - Broadcast message UpdateZRC20PausedStatus
* [zetacored tx fungible update-zrc20-withdraw-fee](zetacored_tx_fungible_update-zrc20-withdraw-fee.md) - Broadcast message UpdateZRC20WithdrawFee

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# tx fungible update-zrc20-paused-status
# tx fungible pause-zrc20

Broadcast message UpdateZRC20PausedStatus
Broadcast message PauseZRC20

```
zetacored tx fungible update-zrc20-paused-status [contractAddress1, contractAddress2, ...] [pausedStatus] [flags]
zetacored tx fungible pause-zrc20 [contractAddress1, contractAddress2, ...] [flags]
```

### Examples

```
zetacored tx fungible update-zrc20-paused-status "0xece40cbB54d65282c4623f141c4a8a0bE7D6AdEc, 0xece40cbB54d65282c4623f141c4a8a0bEjgksncf" 0
zetacored tx fungible pause-zrc20 "0xece40cbB54d65282c4623f141c4a8a0bE7D6AdEc, 0xece40cbB54d65282c4623f141c4a8a0bEjgksncf"
```

### Options
Expand All @@ -28,7 +28,7 @@ zetacored tx fungible update-zrc20-paused-status "0xece40cbB54d65282c4623f141c4a
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
-h, --help help for update-zrc20-paused-status
-h, --help help for pause-zrc20
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used
--ledger Use a connected Ledger device
Expand Down
59 changes: 59 additions & 0 deletions docs/cli/zetacored/zetacored_tx_fungible_unpause-zrc20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# tx fungible unpause-zrc20

Broadcast message UnpauseZRC20

```
zetacored tx fungible unpause-zrc20 [contractAddress1, contractAddress2, ...] [flags]
```

### Examples

```
zetacored tx fungible unpause-zrc20 "0xece40cbB54d65282c4623f141c4a8a0bE7D6AdEc, 0xece40cbB54d65282c4623f141c4a8a0bEjgksncf"
```

### Options

```
-a, --account-number uint The account number of the signing account (offline mode only)
--aux Generate aux signer data instead of sending a tx
-b, --broadcast-mode string Transaction broadcasting mode (sync|async)
--chain-id string The network chain ID
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
--fee-granter string Fee granter grants fees for the transaction
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer
--fees string Fees to pay along with transaction; eg: 10uatom
--from string Name or address of private key with which to sign
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000)
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
-h, --help help for unpause-zrc20
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used
--ledger Use a connected Ledger device
--node string [host]:[port] to tendermint rpc interface for this chain
--note string Note to add a description to the transaction (previously --memo)
--offline Offline mode (does not allow any online functionality)
-o, --output string Output format (text|json)
-s, --sequence uint The sequence number of the signing account (offline mode only)
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
-y, --yes Skip tx broadcasting prompt confirmation
```

### Options inherited from parent commands

```
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--log_no_color Disable colored logs
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands

3 changes: 2 additions & 1 deletion docs/cli/zetacored/zetacored_tx_observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ zetacored tx observer [flags]
* [zetacored tx](zetacored_tx.md) - Transactions subcommands
* [zetacored tx observer add-blame-vote](zetacored_tx_observer_add-blame-vote.md) - Broadcast message add-blame-vote
* [zetacored tx observer add-observer](zetacored_tx_observer_add-observer.md) - Broadcast message add-observer
* [zetacored tx observer disable-cctx-flags](zetacored_tx_observer_disable-cctx-flags.md) - Disable inbound and outbound cross-chain flags
* [zetacored tx observer enable-cctx-flags](zetacored_tx_observer_enable-cctx-flags.md) - Enable inbound and outbound cross-chain flags
* [zetacored tx observer encode](zetacored_tx_observer_encode.md) - Encode a json string into hex
* [zetacored tx observer remove-chain-params](zetacored_tx_observer_remove-chain-params.md) - Broadcast message to remove chain params
* [zetacored tx observer reset-chain-nonces](zetacored_tx_observer_reset-chain-nonces.md) - Broadcast message to reset chain nonces
* [zetacored tx observer update-chain-params](zetacored_tx_observer_update-chain-params.md) - Broadcast message updateChainParams
* [zetacored tx observer update-crosschain-flags](zetacored_tx_observer_update-crosschain-flags.md) - Update crosschain flags
* [zetacored tx observer update-keygen](zetacored_tx_observer_update-keygen.md) - command to update the keygen block via a group proposal
* [zetacored tx observer update-observer](zetacored_tx_observer_update-observer.md) - Broadcast message add-observer
* [zetacored tx observer vote-tss](zetacored_tx_observer_vote-tss.md) - Vote for a new TSS creation
Expand Down
53 changes: 53 additions & 0 deletions docs/cli/zetacored/zetacored_tx_observer_disable-cctx-flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# tx observer disable-cctx-flags

Disable inbound and outbound cross-chain flags

```
zetacored tx observer disable-cctx-flags [disable-inbound] [disable-outbound] [flags]
```

### Options

```
-a, --account-number uint The account number of the signing account (offline mode only)
--aux Generate aux signer data instead of sending a tx
-b, --broadcast-mode string Transaction broadcasting mode (sync|async)
--chain-id string The network chain ID
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
--fee-granter string Fee granter grants fees for the transaction
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer
--fees string Fees to pay along with transaction; eg: 10uatom
--from string Name or address of private key with which to sign
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000)
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
-h, --help help for disable-cctx-flags
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used
--ledger Use a connected Ledger device
--node string [host]:[port] to tendermint rpc interface for this chain
--note string Note to add a description to the transaction (previously --memo)
--offline Offline mode (does not allow any online functionality)
-o, --output string Output format (text|json)
-s, --sequence uint The sequence number of the signing account (offline mode only)
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
-y, --yes Skip tx broadcasting prompt confirmation
```

### Options inherited from parent commands

```
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--log_no_color Disable colored logs
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# tx observer update-crosschain-flags
# tx observer enable-cctx-flags

Update crosschain flags
Enable inbound and outbound cross-chain flags

```
zetacored tx observer update-crosschain-flags [is-inbound-enabled] [is-outbound-enabled] [flags]
zetacored tx observer enable-cctx-flags [enable-inbound] [enable-outbound] [flags]
```

### Options
Expand All @@ -22,7 +22,7 @@ zetacored tx observer update-crosschain-flags [is-inbound-enabled] [is-outbound-
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
-h, --help help for update-crosschain-flags
-h, --help help for enable-cctx-flags
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used
--ledger Use a connected Ledger device
Expand Down
22 changes: 13 additions & 9 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56357,13 +56357,17 @@ definitions:
- groupEmergency
- groupOperational
- groupAdmin
- emptyPolicyType
default: groupEmergency
description: |-
- groupEmergency: Used for emergency situations that require immediate action
- groupOperational: Used for operational tasks like changing
- groupAdmin: non-sensitive protocol parameters

Used for administrative tasks like changing sensitive
- emptyPolicyType: protocol parameters or moving funds

Used for empty policies, to represent a situation when
title: PolicyType defines the type of policy
authorityQueryGetPoliciesResponse:
type: object
Expand Down Expand Up @@ -57024,16 +57028,18 @@ definitions:
type: string
systemContract:
type: string
fungibleMsgPauseZRC20Response:
type: object
fungibleMsgRemoveForeignCoinResponse:
type: object
fungibleMsgUnpauseZRC20Response:
type: object
fungibleMsgUpdateContractBytecodeResponse:
type: object
fungibleMsgUpdateSystemContractResponse:
type: object
fungibleMsgUpdateZRC20LiquidityCapResponse:
type: object
fungibleMsgUpdateZRC20PausedStatusResponse:
type: object
fungibleMsgUpdateZRC20WithdrawFeeResponse:
type: object
fungibleQueryAllForeignCoinsResponse:
Expand Down Expand Up @@ -57088,12 +57094,6 @@ definitions:
type: string
connector_zevm:
type: string
fungibleUpdatePausedStatusAction:
type: string
enum:
- PAUSE
- UNPAUSE
default: PAUSE
googlerpcStatus:
type: object
properties:
Expand Down Expand Up @@ -57352,13 +57352,17 @@ definitions:
type: object
observerMsgAddObserverResponse:
type: object
observerMsgDisableCCTXFlagsResponse:
type: object
observerMsgEnableCCTXFlagsResponse:
type: object
observerMsgRemoveChainParamsResponse:
type: object
observerMsgResetChainNoncesResponse:
type: object
observerMsgUpdateChainParamsResponse:
type: object
observerMsgUpdateCrosschainFlagsResponse:
observerMsgUpdateGasPriceIncreaseFlagsResponse:
type: object
observerMsgUpdateKeygenResponse:
type: object
Expand Down
19 changes: 13 additions & 6 deletions docs/spec/fungible/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,25 @@ message MsgUpdateZRC20WithdrawFee {
}
```

## MsgUpdateZRC20PausedStatus
## MsgPauseZRC20

UpdateZRC20PausedStatus updates the paused status of a ZRC20
The list of ZRC20s are either paused or unpaused
PauseZRC20 pauses the ZRC20 token

Authorized: admin policy group 1 (pausing), group 2 (pausing & unpausing)
```proto
message MsgPauseZRC20 {
string creator = 1;
string zrc20_addresses = 2;
}
```

## MsgUnpauseZRC20

UnpauseZRC20 unpauses the ZRC20 token

```proto
message MsgUpdateZRC20PausedStatus {
message MsgUnpauseZRC20 {
string creator = 1;
string zrc20_addresses = 2;
UpdatePausedStatusAction action = 3;
}
```

Expand Down
46 changes: 29 additions & 17 deletions docs/spec/observer/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,6 @@ message MsgAddBlameVote {
}
```

## MsgUpdateCrosschainFlags

UpdateCrosschainFlags updates the crosschain related flags.

Aurthorized: admin policy group 1 (except enabling/disabled
inbounds/outbounds and gas price increase), admin policy group 2 (all).

```proto
message MsgUpdateCrosschainFlags {
string creator = 1;
bool isInboundEnabled = 3;
bool isOutboundEnabled = 4;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 5;
BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6;
}
```

## MsgUpdateKeygen

UpdateKeygen updates the block height of the keygen and sets the status to
Expand Down Expand Up @@ -143,3 +126,32 @@ message MsgVoteTSS {
}
```

## MsgEnableCCTXFlags

```proto
message MsgEnableCCTXFlags {
string creator = 1;
bool enableInbound = 2;
bool enableOutbound = 3;
}
```

## MsgDisableCCTXFlags

```proto
message MsgDisableCCTXFlags {
string creator = 1;
bool disableInbound = 2;
bool disableOutbound = 3;
}
```

## MsgUpdateGasPriceIncreaseFlags

```proto
message MsgUpdateGasPriceIncreaseFlags {
string creator = 1;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 2;
}
```

Loading
Loading