Skip to content

Commit

Permalink
Merge branch 'develop' into fix-code4rena-miss-intx
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie authored Dec 20, 2023
2 parents 6c1691c + cdeb3e3 commit f9da503
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 92 deletions.
98 changes: 9 additions & 89 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
- CC_linux_amd64=x86_64-linux-gnu-gcc
- CXX_linux_amd64=x86_64-linux-gnu-g++
- CC_windows_amd64=x86_64-w64-mingw32-gcc
- CXX_windows_amd64=x86_64-w64-mingw32-g++
- CXX_windows_amd64=x86_64-w64-mingw32-g++
- VERSION={{ .Version }}
- COMMIT={{ .Commit }}
- BUILDTIME={{ .Date }}
Expand All @@ -32,9 +32,9 @@ before:
- go mod tidy

builds:
- id: "zetacored_testnet"
- id: "zetacored"
main: ./cmd/zetacored
binary: "zetacored_testnet-{{ .Os }}-{{ .Arch }}"
binary: "zetacored-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
Expand All @@ -48,9 +48,8 @@ builds:
ignore:
- goos: windows
goarch: arm64
flags: &default_testnet_flags
- -tags=TESTNET,pebbledb,ledger,cgo,netgo
- -installsuffix=static
flags: &default_flags
- -tags=pebbledb,ledger
ldflags: &default_ldflags
- -X github.com/cosmos/cosmos-sdk/version.Name=zetacore
- -X github.com/cosmos/cosmos-sdk/version.ServerName=zetacored
Expand All @@ -61,11 +60,11 @@ builds:
- -X github.com/zeta-chain/zetacore/common.Version={{ .Version }}
- -X github.com/zeta-chain/zetacore/common.CommitHash={{ .Env.COMMIT }}
- -X github.com/zeta-chain/zetacore/common.BuildTime=={{ .Env.BUILDTIME }}
- -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb
- -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb

- id: "zetaclientd_testnet"
- id: "zetaclientd"
main: ./cmd/zetaclientd
binary: "zetaclientd_testnet-{{ .Os }}-{{ .Arch }}"
binary: "zetaclientd-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
Expand All @@ -79,88 +78,9 @@ builds:
ignore:
- goos: windows
goarch: arm64
flags: *default_testnet_flags
flags: *default_flags
ldflags: *default_ldflags

- id: "zetacored_mock_mainnet"
main: ./cmd/zetacored
binary: "zetacored_mock_mainnet-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
goos:
- linux
- darwin
- windows
goarch:
- arm64
- amd64
ignore:
- goos: windows
goarch: arm64
flags: &default_mock_mainnet_flags
- -tags=MOCK_MAINNET,pebbledb,ledger,cgo
ldflags: *default_ldflags

- id: "zetaclientd_mock_mainnet"
main: ./cmd/zetaclientd
binary: "zetaclientd_mock_mainnet-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
goos:
- linux
# - darwin
# - windows
goarch:
- arm64
- amd64
ignore:
- goos: windows
goarch: arm64
flags: *default_mock_mainnet_flags
ldflags: *default_ldflags

- id: "zetacored_mainnet"
main: ./cmd/zetacored
binary: "zetacored_mainnet-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
goos:
- linux
- darwin
- windows
goarch:
- arm64
- amd64
ignore:
- goos: windows
goarch: arm64
flags: &default_mainnet_flags
- -tags=pebbledb,ledger,cgo
ldflags: *default_ldflags

- id: "zetaclientd_mainnet"
main: ./cmd/zetaclientd
binary: "zetaclientd_mainnet-{{ .Os }}-{{ .Arch }}"
env:
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
goos:
- linux
# - darwin
# - windows
goarch:
- arm64
- amd64
ignore:
- goos: windows
goarch: arm64
flags: *default_mainnet_flags
ldflags: *default_ldflags


archives:
- format: binary
name_template: "{{ .Binary }}"
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Features
* [1395](https://github.com/zeta-chain/node/pull/1395) - Add state variable to track aborted zeta amount
* [1387](https://github.com/zeta-chain/node/pull/1387) - Add HSM capability for zetaclient hot key
* [1410](https://github.com/zeta-chain/node/pull/1410) - `snapshots` commands
* enable zetaclients to use dynamic gas price on zetachain - enables >0 min_gas_price in feemarket module
* add static chain data for Sepolia testnet
* added metrics to track the burn rate of the hotkey in the telemetry server as well as prometheus
Expand Down Expand Up @@ -46,6 +47,8 @@

### Chores

* [1442](https://github.com/zeta-chain/node/pull/1442) - remove build types in `.goreleaser.yaml`

### Tests
- Add unit tests for adding votes to a ballot
### CI
Expand Down
10 changes: 7 additions & 3 deletions cmd/zetacored/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os"
"path/filepath"

"github.com/cosmos/cosmos-sdk/client/snapshot"

appparams "github.com/cosmos/cosmos-sdk/simapp/params"
snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
"github.com/evmos/ethermint/crypto/hd"
Expand Down Expand Up @@ -119,6 +121,10 @@ func initTmConfig() *tmcfg.Config {
}

func initRootCmd(rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig) {
ac := appCreator{
encCfg: encodingConfig,
}

rootCmd.AddCommand(
ethermintclient.ValidateChainID(
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
Expand All @@ -136,11 +142,9 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig

debug.Cmd(),
config.Cmd(),
snapshot.Cmd(ac.newApp),
)

ac := appCreator{
encCfg: encodingConfig,
}
zevmserver.AddCommands(rootCmd, zevmserver.NewDefaultStartOptions(ac.newApp, app.DefaultNodeHome), ac.appExport, addModuleInitFlags)

// the ethermintserver one supercedes the sdk one
Expand Down
1 change: 1 addition & 0 deletions docs/cli/zetacored/zetacored.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Zetacore Daemon (server)
* [zetacored query](zetacored_query.md) - Querying subcommands
* [zetacored rollback](zetacored_rollback.md) - rollback cosmos-sdk and tendermint state by one height
* [zetacored rosetta](zetacored_rosetta.md) - spin up a rosetta server
* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots
* [zetacored start](zetacored_start.md) - Run the full node
* [zetacored status](zetacored_status.md) - Query remote node for status
* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands
Expand Down
29 changes: 29 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# snapshots

Manage local snapshots

### Options

```
-h, --help help for snapshots
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored](zetacored.md) - Zetacore Daemon (server)
* [zetacored snapshots delete](zetacored_snapshots_delete.md) - Delete a local snapshot
* [zetacored snapshots dump](zetacored_snapshots_dump.md) - Dump the snapshot as portable archive format
* [zetacored snapshots export](zetacored_snapshots_export.md) - Export app state to snapshot store
* [zetacored snapshots list](zetacored_snapshots_list.md) - List local snapshots
* [zetacored snapshots load](zetacored_snapshots_load.md) - Load a snapshot archive file (.tar.gz) into snapshot store
* [zetacored snapshots restore](zetacored_snapshots_restore.md) - Restore app state from local snapshot

27 changes: 27 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# snapshots delete

Delete a local snapshot

```
zetacored snapshots delete [height] [format] [flags]
```

### Options

```
-h, --help help for delete
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots

28 changes: 28 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots_dump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# snapshots dump

Dump the snapshot as portable archive format

```
zetacored snapshots dump [height] [format] [flags]
```

### Options

```
-h, --help help for dump
-o, --output string output file
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots

28 changes: 28 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots_export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# snapshots export

Export app state to snapshot store

```
zetacored snapshots export [flags]
```

### Options

```
--height int Height to export, default to latest state height
-h, --help help for export
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots

27 changes: 27 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# snapshots list

List local snapshots

```
zetacored snapshots list [flags]
```

### Options

```
-h, --help help for list
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots

27 changes: 27 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots_load.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# snapshots load

Load a snapshot archive file (.tar.gz) into snapshot store

```
zetacored snapshots load [archive-file] [flags]
```

### Options

```
-h, --help help for load
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots

31 changes: 31 additions & 0 deletions docs/cli/zetacored/zetacored_snapshots_restore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# snapshots restore

Restore app state from local snapshot

### Synopsis

Restore app state from local snapshot

```
zetacored snapshots restore [height] [format] [flags]
```

### Options

```
-h, --help help for restore
```

### 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)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored snapshots](zetacored_snapshots.md) - Manage local snapshots

0 comments on commit f9da503

Please sign in to comment.