-
Notifications
You must be signed in to change notification settings - Fork 398
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
feat: clean up p2p
& implement missing peering functionality
#2852
Changes from 62 commits
a929e52
a7f40f1
e91a1a8
ea6d19a
38a446c
398f86a
373f489
f934a84
93fa469
8536074
338c93b
e5d7861
fefba77
2f11de2
1c0152e
1653571
989ea8d
a0e1f28
eb2a7a1
b238bf3
728742d
8af018a
06433ec
8e09e82
7606475
2c503c9
a11726e
e7a987b
a07d7a9
1f96b45
2c96044
1d71df7
9b156bc
ba9c83d
c744b3f
1f952da
d32b926
85de00e
a82475e
7c59c13
a179026
d4ff457
bf94f1e
8c0e6a6
b02dd87
1984848
372e37d
a28c814
7d64ff9
71c9c25
d47c2e1
a0a6341
585f20e
a9dd9dd
6af09bf
32e019a
67749b1
6ad9353
b1ff84f
67184aa
6d37602
3e24a50
bd7d1b9
c7cb9e9
375b1e0
710457a
d974601
cec59db
515bc73
32b843c
c208027
50cb690
b572b70
5702e74
a2c11a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import ( | |
"github.com/gnolang/gno/tm2/pkg/amino" | ||
"github.com/gnolang/gno/tm2/pkg/bft/privval" | ||
"github.com/gnolang/gno/tm2/pkg/crypto" | ||
"github.com/gnolang/gno/tm2/pkg/p2p" | ||
"github.com/gnolang/gno/tm2/pkg/p2p/types" | ||
) | ||
|
||
var ( | ||
|
@@ -54,7 +54,7 @@ func isValidDirectory(dirPath string) bool { | |
} | ||
|
||
type secretData interface { | ||
privval.FilePVKey | privval.FilePVLastSignState | p2p.NodeKey | ||
privval.FilePVKey | privval.FilePVLastSignState | types.NodeKey | ||
} | ||
|
||
// readSecretData reads the secret data from the given path | ||
|
@@ -145,7 +145,7 @@ func validateValidatorStateSignature( | |
} | ||
|
||
// validateNodeKey validates the node's p2p key | ||
func validateNodeKey(key *p2p.NodeKey) error { | ||
func validateNodeKey(key *types.NodeKey) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even if p2p/types is the module name, the usage should not be "types" unless it is within the same parent module like within p2p. cmd/gnoland/secrets_common.go is outside of p2p, so it should be p2p, unless there's a reason why it can't be, then it could be p2ptypes, but why can't it be p2p? |
||
if key.PrivKey == nil { | ||
return errInvalidNodeKey | ||
} | ||
|
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.
things that you often do arithmetic operations on especially comparison operations, should remain as signed numbers.
x > y is often expressed as x - y > 0, which doesn't work with unsigned numbers, more bug prone. we are exchanging 1 bit for code brittleness.