-
Notifications
You must be signed in to change notification settings - Fork 10
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
Chores grooming #11
Chores grooming #11
Conversation
README.md
Outdated
``` | ||
|
||
Its also possible to use yaml configuration file `./config/initiator.yaml` for parameters. `dkgcli` will be looking for this file at `./config/` folder. | ||
Its also possible to use yaml configuration file `./config/initiator.yaml` for parameters. `dkgcli` will be looking for this file at `./config/` folder at a same root as the binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dkgcli -> ssv-dkg
README.md
Outdated
``` | ||
|
||
When using configuration file, run: | ||
|
||
```sh | ||
dkgcli init-dkg | ||
ssv-dkg init-dkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be just ssv-dkg init
no need to repeat dkg
README.md
Outdated
port: 3030 | ||
storeShare: true | ||
``` | ||
|
||
When using configuration file, run: | ||
|
||
```sh | ||
dkgcli start-dkg-server | ||
ssv-dkg start-dkg-operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start-dkg-operator
-> start-operator
integration_test/integration_test.go
Outdated
// t.Run("test 7 operators happy flow", func(t *testing.T) { | ||
// ops := make(map[uint64]initiator.Operator) | ||
// srv1 := CreateOperator(t, 1) | ||
// ops[1] = initiator.Operator{srv1.srv.URL, 1, &srv1.privKey.PublicKey} | ||
// srv2 := CreateOperator(t, 2) | ||
// ops[2] = initiator.Operator{srv2.srv.URL, 2, &srv2.privKey.PublicKey} | ||
// srv3 := CreateOperator(t, 3) | ||
// ops[3] = initiator.Operator{srv3.srv.URL, 3, &srv3.privKey.PublicKey} | ||
// srv4 := CreateOperator(t, 4) | ||
// ops[4] = initiator.Operator{srv4.srv.URL, 4, &srv4.privKey.PublicKey} | ||
// srv5 := CreateOperator(t, 5) | ||
// ops[5] = initiator.Operator{srv5.srv.URL, 5, &srv5.privKey.PublicKey} | ||
// srv6 := CreateOperator(t, 6) | ||
// ops[6] = initiator.Operator{srv6.srv.URL, 6, &srv6.privKey.PublicKey} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this commented? anyway it should be pretty easy to write the functionality to run 4/7/13 tests without copy pasting so much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, some leftover I forgot about. Should be uncommented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! please see my comments, also lets fix tests.
Lets please remove unused functions such as: https://github.com/bloxapp/ssv-dkg/blob/ac06e5464f055fb39b5cdd854deba17b81308266/pkgs/load/operators.go OperatorsPubkeys(path string) |
@pavelkrolevets can we please add lint command to Makefile |
@echo "Done building." | ||
@echo "Run dkgcli to launch the tool." | ||
@echo "Run ssv-dkg to launch the tool." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@echo "Run ssv-dkg to launch the tool." | |
@echo "ssv-dkg installed successfully." |
README.md
Outdated
@@ -1,77 +1,112 @@ | |||
# ssv-dkg-tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# ssv-dkg-tool | |
# ssv-dkg |
incorporate logs to file similar to ssv |
Additional chores:
|
make docker-build fails after make build (add .dockerignore to exclude bin folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see conversion
|
deposit and payload files should have a prefix (validator pk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
@moshe-blox @andrew-blox please take final look so we can merge
return nil, err | ||
} | ||
block, _ := pem.Decode(operatorKeyByte) | ||
// TODO: resolve deprecation https://github.com/golang/go/issues/8860 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we resolve this?
b := block.Bytes | ||
if enc { | ||
var err error | ||
// TODO: resolve deprecation https://github.com/golang/go/issues/8860 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we resolve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we have the same thing in our node, @MatusKysel mentioned something about the way we do RSA, maybe we should revisit it entirely, for sure it's not the place to do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Left a few comments, although did not finish reviewing yet.
cli/initiator/initiator.go
Outdated
} | ||
nonce := viper.GetUint64("nonce") | ||
withdrawPubKey, err := hex.DecodeString(withdrawAddr) | ||
withdrawPubKey := common.HexToAddress(withdrawAddr).Bytes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HexToAddress
is dangerous for user input because it fails silently, so you can pass just an "m" (for example) and it would continue without notifying the user of his mistake.
WDYT about making our own address parsing func that would return an error if input is too long, too short or not a valid hex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added HexToAddress with error handling to utils + unit tests for it
@@ -132,10 +134,14 @@ func New(key *rsa.PrivateKey) *Server { | |||
} | |||
|
|||
func (s *Server) Start(port uint16) error { | |||
s.Logger.Infof("server listening for incoming requests on port %d", port) | |||
srv := &http.Server{Addr: fmt.Sprintf(":%v", port), Handler: s.Router} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR, but it'd be nice if we can add read/write timeouts to the `http.Server to prevent flooding attacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have Chi limiting requests to routes, to prevent DDOS, if I understood you correctly
pkgs/operator/state.go
Outdated
logger.Info("🚀 Initializing DKG instance") | ||
init := &wire.Init{} | ||
if err := init.UnmarshalSSZ(initMsg.Data); err != nil { | ||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should return error wrappings (as you did below in VerifyRSA
) here and in the rest of the returns, so we can tell where exactly things failed in retrospect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added error wrapps at state. Should we have wrapps everywhere?
- change deposit and keyshares results param names
Merged as part 1 of grooming |
No description provided.