-
Notifications
You must be signed in to change notification settings - Fork 701
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
tmpnet
: Move tmpnet/local to tmpnet package
#2457
Conversation
62916a1
to
5bb8d41
Compare
tests/fixture/tmpnet/config.go
Outdated
@@ -206,6 +197,24 @@ func (nc *NodeConfig) EnsureKeys() error { | |||
return nc.EnsureNodeID() | |||
} | |||
|
|||
// Derives the nodes proof-of-possession. Requires the node to have a | |||
// BLS signing key. | |||
func (nc *NodeConfig) GetProofOfPosession() (*signer.ProofOfPossession, error) { |
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.
typo: GetProofOfPossession?
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.
Whoops, fixed in parent.
tests/fixture/tmpnet/config.go
Outdated
errInvalidKeypair = fmt.Errorf("%q and %q must be provided together or not at all", config.StakingTLSKeyContentKey, config.StakingCertContentKey) | ||
errNoKeysForGenesis = errors.New("failed to generate genesis: no keys to fund") | ||
errInvalidNetworkIDForGenesis = errors.New("network ID can't be mainnet, testnet or local network ID") | ||
errMissingStakersForGenesis = errors.New("no genesis stakers provided") |
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.
q: do we set in genesis stakers that are not validators?
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.
No, I'm assuming that stakers are always validators. Is that a valid assumption?
// Defines the configuration required for a tempoary network | ||
type Network struct { | ||
NetworkConfig | ||
NodeRuntimeConfig |
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.
q: is is the same runtime config for every node in the network?
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.
Yes, that is the case. While it was possible to modify the exec path per node (e.g. for the upgrade test) it wasn't persisted. The next PR will enable per-node persistent runtime configuration.
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.
mostly questions and nits
5bb8d41
to
0e6d8ec
Compare
f9aada9
to
3e42f16
Compare
43e53fc
to
437bcb6
Compare
3e42f16
to
184b8d8
Compare
tmpnet
: Move tmpnet/local to tmpnet package
184b8d8
to
ae08b7e
Compare
ae08b7e
to
19dca4a
Compare
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.
LGTM - one optional nit based on my own preference (NodeID instead of ID)
tests/e2e/c/dynamic_fees.go
Outdated
nodeURI := tmpnet.NodeURI{ | ||
NodeID: node.GetID(), | ||
URI: node.GetProcessContext().URI, | ||
ID: node.ID, |
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.
optional nit: I think using NodeID is more explicit than ID, which can be confusing at times, so I'd prefer to keep the field name NodeID
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.
Ack, I'll make that change.
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.
Is your comment just for NodeURI
, or should it also apply to tmpnet.Node.ID
?
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.
I think we should use the NodeID
type for all Node IDs.
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.
Done
5552748
to
e20e8f7
Compare
e20e8f7
to
93dc814
Compare
This is the first step in a refactor in support of deploying temporary networks to kubernetes.
Co-authored-by: aaronbuchwald <[email protected]>
4b22d47
to
cb968e8
Compare
Co-authored-by: aaronbuchwald <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
Previously the tmpnet code was separated into
tmpnet
andtmpnet.local
packages. The intention was fortmpnet
to define common interfaces and configuration, andtmpnet.local
to orchestrate process-based temporary networks.I eventually realized that the previous abstractions were unnecessary. A process- or kube-based network need only differ in its runtime - the code that starts/stops/etc the node. The configuration will be largely similar and can all be stored in the same way. Hence this PR: removing the concept of
Local{Node,Network,Config}
in favor of Node/Network/Config. Subsequent PRs will introduce the concept ofNodeRuntime
to support the choice of nodes run as processes or pods.