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(zetaclient)!: remove hsm signer #3118

Merged
merged 3 commits into from
Nov 6, 2024
Merged
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
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ BUILD_FLAGS := -ldflags '$(ldflags)' -tags pebbledb,ledger

TEST_DIR ?= "./..."
TEST_BUILD_FLAGS := -tags pebbledb,ledger
HSM_BUILD_FLAGS := -tags pebbledb,ledger,hsm_test

export DOCKER_BUILDKIT := 1

Expand Down Expand Up @@ -73,9 +72,6 @@ test: clean-test-dir run-test
run-test:
@go test ${TEST_BUILD_FLAGS} ${TEST_DIR}

test-hsm:
@go test ${HSM_BUILD_FLAGS} ${TEST_DIR}

# Generate the test coverage
# "|| exit 1" is used to return a non-zero exit code if the tests fail
test-coverage:
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [3075](https://github.com/zeta-chain/node/pull/3075) - ton: withdraw concurrent, deposit & revert.

### Refactor
* [3118](https://github.com/zeta-chain/node/pull/3118) - zetaclient: remove hsm signer

### Tests

Expand Down
1 change: 0 additions & 1 deletion cmd/zetaclientd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func debugCmd(_ *cobra.Command, args []string) error {
debugArgs.zetaNode,
"",
debugArgs.zetaChainID,
false,
zerolog.Nop(),
)
if err != nil {
Expand Down
105 changes: 0 additions & 105 deletions cmd/zetaclientd/hsm.go

This file was deleted.

7 changes: 0 additions & 7 deletions cmd/zetaclientd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ type initArguments struct {
TssPath string
TestTssKeysign bool
KeyringBackend string
HsmMode bool
HsmHotKey string
RelayerKeyPath string
}

Expand Down Expand Up @@ -67,9 +65,6 @@ func init() {
BoolVar(&initArgs.TestTssKeysign, "test-tss", false, "set to to true to run a check for TSS keysign on startup")
InitCmd.Flags().
StringVar(&initArgs.KeyringBackend, "keyring-backend", string(config.KeyringBackendTest), "keyring backend to use (test, file)")
InitCmd.Flags().BoolVar(&initArgs.HsmMode, "hsm-mode", false, "enable hsm signer, default disabled")
InitCmd.Flags().
StringVar(&initArgs.HsmHotKey, "hsm-hotkey", "hsm-hotkey", "name of hotkey associated with hardware security module")
InitCmd.Flags().
StringVar(&initArgs.RelayerKeyPath, "relayer-key-path", "~/.zetacored/relayer-keys", "path to relayer keys")
}
Expand Down Expand Up @@ -107,8 +102,6 @@ func Initialize(_ *cobra.Command, _ []string) error {
configData.P2PDiagnosticTicker = initArgs.p2pDiagnosticTicker
configData.ConfigUpdateTicker = initArgs.configUpdateTicker
configData.KeyringBackend = config.KeyringBackend(initArgs.KeyringBackend)
configData.HsmMode = initArgs.HsmMode
configData.HsmHotKey = initArgs.HsmHotKey
configData.RelayerKeyPath = initArgs.RelayerKeyPath
configData.ComplianceConfig = sample.ComplianceConfig()

Expand Down
5 changes: 1 addition & 4 deletions cmd/zetaclientd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ func CreateAuthzSigner(granter string, grantee sdk.AccAddress) {

func CreateZetacoreClient(cfg config.Config, hotkeyPassword string, logger zerolog.Logger) (*zetacore.Client, error) {
hotKey := cfg.AuthzHotkey
if cfg.HsmMode {
hotKey = cfg.HsmHotKey
}

chainIP := cfg.ZetaCoreURL

Expand All @@ -34,7 +31,7 @@ func CreateZetacoreClient(cfg config.Config, hotkeyPassword string, logger zerol

k := keys.NewKeysWithKeybase(kb, granterAddreess, cfg.AuthzHotkey, hotkeyPassword)

client, err := zetacore.NewClient(k, chainIP, hotKey, cfg.ChainID, cfg.HsmMode, logger)
client, err := zetacore.NewClient(k, chainIP, hotKey, cfg.ChainID, logger)
if err != nil {
return nil, err
}
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
github.com/emicklei/proto v1.11.1
github.com/ethereum/go-ethereum v1.13.15
github.com/fatih/color v1.14.1
github.com/frumioj/crypto11 v1.2.5-0.20210823151709-946ce662cc0e
github.com/gagliardetto/solana-go v1.10.0
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.4
Expand Down Expand Up @@ -57,7 +56,6 @@ require (
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/zeta-chain/ethermint v0.0.0-20241105191054-1ebf85a354a0
github.com/zeta-chain/keystone/keys v0.0.0-20240826165841-3874f358c138
github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241021075719-d40d2e28467c
gitlab.com/thorchain/tss/go-tss v1.6.5
go.nhat.io/grpcmock v0.25.0
Expand Down Expand Up @@ -220,7 +218,6 @@ require (
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.54 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
Expand Down Expand Up @@ -271,7 +268,6 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/btcd v0.1.1 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/thales-e-security/pool v0.0.2 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
Expand Down Expand Up @@ -337,12 +333,15 @@ require (
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220328075252-7dd334e3daae // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
github.com/otiai10/mint v1.3.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand Down
Loading
Loading