-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1333: Fixes some build issues when importing `flow-go` as a dependency r=jordanschalm a=jordanschalm This fixes 2 build issues when using `flow-go` as a dependency. 1. The dkg controller factory mock did not have a relic build tag set, but made use of a relic-tagged interface. Solution: Move the interface to a non-relic-tagged file. ``` ../flow-go/module/mock/dkg_controller_factory.go:18:108: undefined: module.DKGController ../flow-go/module/mock/dkg_controller_factory.go:21:9: undefined: module.DKGController ../flow-go/module/mock/dkg_controller_factory.go:22:67: undefined: module.DKGController ../flow-go/module/mock/dkg_controller_factory.go:26:21: undefined: module.DKGController ``` 2. The networking layer imported a function which did not exist in the `crypto` version pinned by `flow-go`. For local development this worked, because we replace with the local `crypto` module, but failed when used as a dependency. ``` ../flow-go/network/p2p/keyutils/keyTranslator.go:169:14: undefined: "github.com/onflow/flow-go/crypto".DecodePublicKeyCompressed ``` Co-authored-by: Jordan Schalm <jordan@dapperlabs.com>
- Loading branch information
Showing
5 changed files
with
50 additions
and
42 deletions.
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
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
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,40 @@ | ||
// +build relic | ||
|
||
package module | ||
|
||
import ( | ||
"github.com/onflow/flow-go/crypto" | ||
"github.com/onflow/flow-go/model/flow" | ||
"github.com/onflow/flow-go/model/messages" | ||
) | ||
|
||
// DKGBroker extends the crypto.DKGProcessor interface with methods that enable | ||
// a controller to access the channel of incoming messages, and actively fetch | ||
// new DKG broadcast messages. | ||
type DKGBroker interface { | ||
crypto.DKGProcessor | ||
|
||
// GetIndex returns the index of this node in the DKG committee list. | ||
GetIndex() int | ||
|
||
// GetPrivateMsgCh returns the channel through which a user can receive | ||
// incoming private DKGMessages. | ||
GetPrivateMsgCh() <-chan messages.DKGMessage | ||
|
||
// GetBroadcastMsgCh returns the channel through which a user can receive | ||
// incoming broadcast DKGMessages. | ||
GetBroadcastMsgCh() <-chan messages.DKGMessage | ||
|
||
// Poll instructs the broker to actively fetch broadcast messages (ex. read | ||
// from DKG smart contract). The messages will be forwarded through the | ||
// broker's message channel (cf. GetMsgCh). The method does not return until | ||
// all received messages are processed by the consumer. | ||
Poll(referenceBlock flow.Identifier) error | ||
|
||
// SubmitResult instructs the broker to publish the results of the DKG run | ||
// (ex. publish to DKG smart contract). | ||
SubmitResult(crypto.PublicKey, []crypto.PublicKey) error | ||
|
||
// Shutdown causes the broker to stop listening and forwarding messages. | ||
Shutdown() | ||
} |