-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into ci-add-docker-build-and-push
- Loading branch information
Showing
4 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## Hot Key and TSS key-share Passwords | ||
|
||
### Zetaclient | ||
Previously there were two environment variables being used to store passwords encrypting the tss key file and local operator keyring file: | ||
|
||
* HOTKEY_PASSWORD | ||
* TSS_FRAGMENT_SEED | ||
|
||
With this new change, these variables will no longer be valid. | ||
Instead, a series of prompts will appear asking for passwords using STDIN during the startup process. | ||
|
||
* Hot Key password | ||
* TSS Key share password | ||
|
||
If your key files are already encrypted, you can use the same passwords you provided in the environment variables. | ||
|
||
**It's extremely important to take note of these passwords or commit them to memory.** | ||
|
||
### Hot Key | ||
|
||
#### File backend | ||
|
||
* The hot key will use the existing keyring that holds your operator key. The file will be encrypted with your existing password, | ||
make sure to use this same password when starting the client. | ||
|
||
#### Test backend | ||
|
||
* You will still be prompted for a password, but you need to leave it blank which indicates the test backend is being used. | ||
|
||
### TSS Key-Share | ||
|
||
During key-gen, the password you enter will be used to encrypt the generated key-share file. The key data will be stored in | ||
memory once the process is running. If the client needs to be restarted, this key-share file needs to be present on your | ||
machine and will be decrypted using the password you've entered. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package evm | ||
|
||
import ( | ||
"math/big" | ||
"testing" | ||
|
||
ethtypes "github.com/ethereum/go-ethereum/core/types" | ||
lru "github.com/hashicorp/golang-lru" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestEVMBlockCache(t *testing.T) { | ||
// create client | ||
blockCache, err := lru.New(1000) | ||
require.NoError(t, err) | ||
blockCacheV3, err := lru.New(1000) | ||
require.NoError(t, err) | ||
ob := ChainClient{ | ||
blockCache: blockCache, | ||
blockCacheV3: blockCacheV3, | ||
} | ||
|
||
// delete non-existing block should not panic | ||
blockNumber := int64(10388180) | ||
// #nosec G701 possible nummber | ||
ob.RemoveCachedBlock(uint64(blockNumber)) | ||
|
||
// add a block | ||
header := ðtypes.Header{ | ||
Number: big.NewInt(blockNumber), | ||
} | ||
block := ethtypes.NewBlock(header, nil, nil, nil, nil) | ||
ob.blockCache.Add(blockNumber, block) | ||
|
||
// delete the block should not panic | ||
ob.RemoveCachedBlock(uint64(blockNumber)) | ||
} |