Documentation ¶
Overview ¶
Package activation is responsible for creating activation transactions and running the mining flow, coordinating Post building, sending proofs to PoET and building NIPost structs.
Package activation is a generated GoMock package.
Package activation is a generated GoMock package.
Package activation is a generated GoMock package.
Index ¶
- Variables
- func SignAtx(signer signer, atx *types.ActivationTx) error
- type AtxNotFoundError
- type Builder
- func (b *Builder) Coinbase() types.Address
- func (b *Builder) GetPositioningAtxInfo() (types.ATXID, types.LayerID, error)
- func (b *Builder) PublishActivationTx(ctx context.Context) error
- func (b *Builder) SetCoinbase(rewardAddress types.Address)
- func (b *Builder) SignAtx(atx *types.ActivationTx) error
- func (b *Builder) SmesherID() types.NodeID
- func (b *Builder) Smeshing() bool
- func (b *Builder) StartSmeshing(coinbase types.Address, opts PostSetupOpts) error
- func (b *Builder) StopSmeshing(deleteFiles bool) error
- func (b *Builder) UpdatePoETServers(ctx context.Context, endpoints []string) error
- type BuilderOption
- type ChallengeVerificationResult
- type ChallengeVerifier
- type Config
- type HTTPPoetClient
- type HTTPPoetHarness
- type HTTPPoetOpt
- type Handler
- func (h *Handler) AwaitAtx(id types.ATXID) chan struct{}
- func (h *Handler) ContextuallyValidateAtx(atx *types.VerifiedActivationTx) error
- func (h *Handler) FetchAtxReferences(ctx context.Context, atx *types.ActivationTx) error
- func (h *Handler) GetEpochAtxs(epochID types.EpochID) (ids []types.ATXID, err error)
- func (h *Handler) GetPosAtxID() (types.ATXID, error)
- func (h *Handler) HandleAtxData(ctx context.Context, data []byte) error
- func (h *Handler) HandleGossipAtx(ctx context.Context, _ p2p.Peer, msg []byte) pubsub.ValidationResult
- func (h *Handler) ProcessAtx(ctx context.Context, atx *types.VerifiedActivationTx) error
- func (h *Handler) StoreAtx(ctx context.Context, atx *types.VerifiedActivationTx) error
- func (h *Handler) SyntacticallyValidateAtx(ctx context.Context, atx *types.ActivationTx) (*types.VerifiedActivationTx, error)
- func (h *Handler) UnsubscribeAtx(id types.ATXID)
- type MockPoetProvingServiceClient
- func (m *MockPoetProvingServiceClient) EXPECT() *MockPoetProvingServiceClientMockRecorder
- func (m *MockPoetProvingServiceClient) PoetServiceID(arg0 context.Context) ([]byte, error)
- func (m *MockPoetProvingServiceClient) Submit(ctx context.Context, challenge, signature []byte) (*types.PoetRound, error)
- type MockPoetProvingServiceClientMockRecorder
- type MockSmeshingProvider
- func (m *MockSmeshingProvider) Coinbase() types.Address
- func (m *MockSmeshingProvider) EXPECT() *MockSmeshingProviderMockRecorder
- func (m *MockSmeshingProvider) SetCoinbase(arg0 types.Address)
- func (m *MockSmeshingProvider) SmesherID() types.NodeID
- func (m *MockSmeshingProvider) Smeshing() bool
- func (m *MockSmeshingProvider) StartSmeshing(arg0 types.Address, arg1 PostSetupOpts) error
- func (m *MockSmeshingProvider) StopSmeshing(arg0 bool) error
- type MockSmeshingProviderMockRecorder
- func (mr *MockSmeshingProviderMockRecorder) Coinbase() *gomock.Call
- func (mr *MockSmeshingProviderMockRecorder) SetCoinbase(arg0 interface{}) *gomock.Call
- func (mr *MockSmeshingProviderMockRecorder) SmesherID() *gomock.Call
- func (mr *MockSmeshingProviderMockRecorder) Smeshing() *gomock.Call
- func (mr *MockSmeshingProviderMockRecorder) StartSmeshing(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockSmeshingProviderMockRecorder) StopSmeshing(arg0 interface{}) *gomock.Call
- type MockatxHandler
- type MockatxHandlerMockRecorder
- type MockatxProvider
- type MockatxProviderMockRecorder
- type MockatxReceiver
- type MockatxReceiverMockRecorder
- type MocklayerClock
- type MocklayerClockMockRecorder
- type MocknipostBuilder
- type MocknipostBuilderMockRecorder
- type MocknipostValidator
- func (m *MocknipostValidator) EXPECT() *MocknipostValidatorMockRecorder
- func (m *MocknipostValidator) Validate(nodeId types.NodeID, atxId types.ATXID, NIPost *types.NIPost, ...) (uint64, error)
- func (m *MocknipostValidator) ValidatePost(nodeId types.NodeID, atxId types.ATXID, Post *types.Post, ...) error
- func (m *MocknipostValidator) ValidateVRFNonce(nodeId types.NodeID, commitmentAtxId types.ATXID, vrfNonce *types.VRFPostIndex, ...) error
- type MocknipostValidatorMockRecorder
- func (mr *MocknipostValidatorMockRecorder) Validate(nodeId, atxId, NIPost, expectedChallenge, numUnits interface{}) *gomock.Call
- func (mr *MocknipostValidatorMockRecorder) ValidatePost(nodeId, atxId, Post, PostMetadata, numUnits interface{}) *gomock.Call
- func (mr *MocknipostValidatorMockRecorder) ValidateVRFNonce(nodeId, commitmentAtxId, vrfNonce, PostMetadata, numUnits interface{}) *gomock.Call
- type MockpoetDbAPI
- func (m *MockpoetDbAPI) EXPECT() *MockpoetDbAPIMockRecorder
- func (m *MockpoetDbAPI) GetMembershipMap(proofRef types.PoetProofRef) (map[types.Hash32]bool, error)
- func (m *MockpoetDbAPI) GetProof(arg0 types.PoetProofRef) (*types.PoetProof, error)
- func (m *MockpoetDbAPI) GetProofRef(poetID []byte, roundID string) (types.PoetProofRef, error)
- type MockpoetDbAPIMockRecorder
- type MockpoetValidatorPersister
- func (m *MockpoetValidatorPersister) EXPECT() *MockpoetValidatorPersisterMockRecorder
- func (m *MockpoetValidatorPersister) HasProof(arg0 types.PoetProofRef) bool
- func (m *MockpoetValidatorPersister) StoreProof(arg0 context.Context, arg1 types.PoetProofRef, arg2 *types.PoetProofMessage) error
- func (m *MockpoetValidatorPersister) Validate(arg0 types.PoetProof, arg1 []byte, arg2 string, arg3 []byte) error
- type MockpoetValidatorPersisterMockRecorder
- func (mr *MockpoetValidatorPersisterMockRecorder) HasProof(arg0 interface{}) *gomock.Call
- func (mr *MockpoetValidatorPersisterMockRecorder) StoreProof(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockpoetValidatorPersisterMockRecorder) Validate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- type MockpostSetupProvider
- func (m *MockpostSetupProvider) Benchmark(p PostSetupComputeProvider) (int, error)
- func (m *MockpostSetupProvider) ComputeProviders() []PostSetupComputeProvider
- func (m *MockpostSetupProvider) Config() PostConfig
- func (m *MockpostSetupProvider) EXPECT() *MockpostSetupProviderMockRecorder
- func (m *MockpostSetupProvider) GenerateProof(challenge []byte) (*types.Post, *types.PostMetadata, error)
- func (m *MockpostSetupProvider) LastOpts() *PostSetupOpts
- func (m *MockpostSetupProvider) Reset() error
- func (m *MockpostSetupProvider) StartSession(context context.Context, opts PostSetupOpts, commitmentAtx types.ATXID) error
- func (m *MockpostSetupProvider) Status() *PostSetupStatus
- func (m *MockpostSetupProvider) VRFNonce() (*types.VRFPostIndex, error)
- type MockpostSetupProviderMockRecorder
- func (mr *MockpostSetupProviderMockRecorder) Benchmark(p interface{}) *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) ComputeProviders() *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) Config() *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) GenerateProof(challenge interface{}) *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) LastOpts() *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) Reset() *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) StartSession(context, opts, commitmentAtx interface{}) *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) Status() *gomock.Call
- func (mr *MockpostSetupProviderMockRecorder) VRFNonce() *gomock.Call
- type Mocksigner
- type MocksignerMockRecorder
- type Mocksyncer
- type MocksyncerMockRecorder
- type NIPostBuilder
- type PoETClientInitializer
- type PoetConfig
- type PoetDb
- func (db *PoetDb) GetMembershipMap(proofRef types.PoetProofRef) (map[types.Hash32]bool, error)
- func (db *PoetDb) GetProof(proofRef types.PoetProofRef) (*types.PoetProof, error)
- func (db *PoetDb) GetProofMessage(proofRef types.PoetProofRef) ([]byte, error)
- func (db *PoetDb) GetProofRef(poetID []byte, roundID string) (types.PoetProofRef, error)
- func (db *PoetDb) HasProof(proofRef types.PoetProofRef) bool
- func (db *PoetDb) StoreProof(ctx context.Context, ref types.PoetProofRef, ...) error
- func (db *PoetDb) Validate(proof types.PoetProof, poetID []byte, roundID string, signature []byte) error
- func (db *PoetDb) ValidateAndStore(ctx context.Context, proofMessage *types.PoetProofMessage) error
- func (db *PoetDb) ValidateAndStoreMsg(ctx context.Context, data []byte) error
- type PoetListener
- type PoetProvingServiceClient
- type PoetSvcUnstableError
- type PostConfig
- type PostSetupComputeProvider
- type PostSetupManager
- func (mgr *PostSetupManager) Benchmark(p PostSetupComputeProvider) (int, error)
- func (mgr *PostSetupManager) BestProvider() (*PostSetupComputeProvider, error)
- func (*PostSetupManager) ComputeProviders() []PostSetupComputeProvider
- func (mgr *PostSetupManager) Config() PostConfig
- func (mgr *PostSetupManager) GenerateProof(challenge []byte) (*types.Post, *types.PostMetadata, error)
- func (mgr *PostSetupManager) LastOpts() *PostSetupOpts
- func (mgr *PostSetupManager) Reset() error
- func (mgr *PostSetupManager) StartSession(ctx context.Context, opts PostSetupOpts, commitmentAtx types.ATXID) error
- func (mgr *PostSetupManager) Status() *PostSetupStatus
- func (mgr *PostSetupManager) VRFNonce() (*types.VRFPostIndex, error)
- type PostSetupOpts
- type PostSetupState
- type PostSetupStatus
- type SmeshingProvider
- type Validator
- func (v *Validator) Validate(nodeId types.NodeID, commitmentAtxId types.ATXID, nipost *types.NIPost, ...) (uint64, error)
- func (*Validator) ValidatePost(nodeId types.NodeID, commitmentAtxId types.ATXID, PoST *types.Post, ...) error
- func (*Validator) ValidateVRFNonce(nodeId types.NodeID, commitmentAtxId types.ATXID, vrfNonce *types.VRFPostIndex, ...) error
- type VerifyError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrATXChallengeExpired is returned when atx missed its publication window and needs to be regenerated. ErrATXChallengeExpired = errors.New("builder: atx expired") // ErrPoetServiceUnstable is returned when poet quality of service is low. ErrPoetServiceUnstable = &PoetSvcUnstableError{} // ErrPoetProofNotReceived is returned when no poet proof was received. ErrPoetProofNotReceived = errors.New("builder: didn't receive any poet proof") )
var ( ErrSignatureInvalid = errors.New("signature is invalid") ErrChallengeInvalid = errors.New("challenge is invalid") )
Functions ¶
func SignAtx ¶
func SignAtx(signer signer, atx *types.ActivationTx) error
SignAtx signs the atx with specified signer and assigns the signature into atx.Sig this function returns an error if atx could not be converted to bytes.
Types ¶
type AtxNotFoundError ¶
func (*AtxNotFoundError) Error ¶
func (e *AtxNotFoundError) Error() string
func (*AtxNotFoundError) Is ¶
func (e *AtxNotFoundError) Is(target error) bool
func (*AtxNotFoundError) Unwrap ¶
func (e *AtxNotFoundError) Unwrap() error
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder struct is the struct that orchestrates the creation of activation transactions it is responsible for initializing post, receiving poet proof and orchestrating nipst. after which it will calculate total weight and providing relevant view as proof.
func NewBuilder ¶
func NewBuilder(conf Config, nodeID types.NodeID, signer signer, cdb *datastore.CachedDB, hdlr atxHandler, publisher pubsub.Publisher, nipostBuilder nipostBuilder, postSetupProvider postSetupProvider, layerClock layerClock, syncer syncer, log log.Log, opts ...BuilderOption, ) *Builder
NewBuilder returns an atx builder that will start a routine that will attempt to create an atx upon each new layer.
func (*Builder) GetPositioningAtxInfo ¶
GetPositioningAtxInfo returns id and publication layer from the best observed atx.
func (*Builder) PublishActivationTx ¶
PublishActivationTx attempts to publish an atx, it returns an error if an atx cannot be created.
func (*Builder) SetCoinbase ¶ added in v1.0.0
SetCoinbase sets the address rewardAddress to be the coinbase account written into the activation transaction the rewards for blocks made by this miner will go to this address.
func (*Builder) SignAtx ¶
func (b *Builder) SignAtx(atx *types.ActivationTx) error
SignAtx signs the atx and assigns the signature into atx.Sig this function returns an error if atx could not be converted to bytes.
func (*Builder) SmesherID ¶ added in v1.0.0
SmesherID returns the ID of the smesher that created this activation.
func (*Builder) StartSmeshing ¶ added in v1.0.0
func (b *Builder) StartSmeshing(coinbase types.Address, opts PostSetupOpts) error
StartSmeshing is the main entry point of the atx builder. It runs the main loop of the builder and shouldn't be called more than once. If the post data is incomplete or missing, data creation session will be preceded. Changing of the post potions (e.g., number of labels), after initial setup, is supported.
func (*Builder) StopSmeshing ¶ added in v1.0.0
StopSmeshing stops the atx builder. It doesn't wait for the smeshing to stop.
type BuilderOption ¶ added in v1.0.0
type BuilderOption func(*Builder)
BuilderOption ...
func WithContext ¶ added in v1.0.0
func WithContext(ctx context.Context) BuilderOption
WithContext modifies parent context for background job.
func WithPoETClientInitializer ¶ added in v1.0.0
func WithPoETClientInitializer(initializer PoETClientInitializer) BuilderOption
WithPoETClientInitializer modifies initialization logic for PoET client. Used during client update.
func WithPoetConfig ¶ added in v1.0.0
func WithPoetConfig(c PoetConfig) BuilderOption
WithPoetConfig sets the poet config.
func WithPoetRetryInterval ¶ added in v1.0.0
func WithPoetRetryInterval(interval time.Duration) BuilderOption
WithPoetRetryInterval modifies time that builder will have to wait before retrying ATX build process if it failed due to issues with PoET server.
type ChallengeVerifier ¶
type ChallengeVerifier interface {
Verify(ctx context.Context, challenge, signature []byte) (*ChallengeVerificationResult, error)
}
func NewChallengeVerifier ¶
func NewChallengeVerifier(cdb atxProvider, signatureVerifier signing.VerifyExtractor, cfg PostConfig, goldenATX types.ATXID, layersPerEpoch uint32) ChallengeVerifier
type HTTPPoetClient ¶
type HTTPPoetClient struct {
// contains filtered or unexported fields
}
HTTPPoetClient implements PoetProvingServiceClient interface.
func NewHTTPPoetClient ¶
func NewHTTPPoetClient(target string) *HTTPPoetClient
NewHTTPPoetClient returns new instance of HTTPPoetClient for the specified target.
func (*HTTPPoetClient) PoetServiceID ¶ added in v0.1.11
func (c *HTTPPoetClient) PoetServiceID(ctx context.Context) ([]byte, error)
PoetServiceID returns the public key of the PoET proving service.
type HTTPPoetHarness ¶
type HTTPPoetHarness struct { *HTTPPoetClient Stdout io.Reader Stderr io.Reader ErrChan <-chan error Teardown func(cleanup bool) error // contains filtered or unexported fields }
HTTPPoetHarness utilizes a local self-contained poet server instance targeted by an HTTP client, in order to exercise functionality.
func NewHTTPPoetHarness ¶
func NewHTTPPoetHarness(disableBroadcast bool, opts ...HTTPPoetOpt) (*HTTPPoetHarness, error)
NewHTTPPoetHarness returns a new instance of HTTPPoetHarness.
type HTTPPoetOpt ¶ added in v1.0.0
type HTTPPoetOpt func(*integration.ServerConfig)
func WithGateway ¶
func WithGateway(endpoint string) HTTPPoetOpt
type Handler ¶ added in v1.0.0
Handler processes the atxs received from all nodes and their validity status.
func NewHandler ¶ added in v1.0.0
func NewHandler(cdb *datastore.CachedDB, fetcher system.Fetcher, layersPerEpoch uint32, tickSize uint64, goldenATXID types.ATXID, nipostValidator nipostValidator, atxReceiver atxReceiver, log log.Log) *Handler
NewHandler returns a data handler for ATX.
func (*Handler) AwaitAtx ¶ added in v1.0.0
AwaitAtx returns a channel that will receive notification when the specified atx with id is received via gossip.
func (*Handler) ContextuallyValidateAtx ¶ added in v1.0.0
func (h *Handler) ContextuallyValidateAtx(atx *types.VerifiedActivationTx) error
ContextuallyValidateAtx ensures that the previous ATX referenced is the last known ATX for the referenced miner ID. If a previous ATX is not referenced, it validates that indeed there's no previous known ATX for that miner ID.
func (*Handler) FetchAtxReferences ¶ added in v1.0.0
FetchAtxReferences fetches positioning and prev atxs from peers if they are not found in db.
func (*Handler) GetEpochAtxs ¶ added in v1.0.0
GetEpochAtxs returns all valid ATXs received in the epoch epochID.
func (*Handler) GetPosAtxID ¶
GetPosAtxID returns the best (highest layer id), currently known to this node, pos atx id.
func (*Handler) HandleAtxData ¶ added in v1.0.0
HandleAtxData handles atxs received either by gossip or sync.
func (*Handler) HandleGossipAtx ¶ added in v1.0.0
func (h *Handler) HandleGossipAtx(ctx context.Context, _ p2p.Peer, msg []byte) pubsub.ValidationResult
HandleGossipAtx handles the atx gossip data channel.
func (*Handler) ProcessAtx ¶ added in v1.0.0
ProcessAtx validates the active set size declared in the atx, and contextually validates the atx according to atx validation rules it then stores the atx with flag set to validity of the atx.
ATXs received as input must be already syntactically valid. Only contextual validation is performed.
func (*Handler) SyntacticallyValidateAtx ¶ added in v1.0.0
func (h *Handler) SyntacticallyValidateAtx(ctx context.Context, atx *types.ActivationTx) (*types.VerifiedActivationTx, error)
SyntacticallyValidateAtx ensures the following conditions apply, otherwise it returns an error.
- If the sequence number is non-zero: PrevATX points to a syntactically valid ATX whose sequence number is one less than the current ATXs sequence number.
- If the sequence number is zero: PrevATX is empty.
- Positioning ATX points to a syntactically valid ATX.
- NIPost challenge is a hash of the serialization of the following fields: NodeID, SequenceNumber, PrevATXID, LayerID, StartTick, PositioningATX.
- The NIPost is valid.
- ATX LayerID is NIPostLayerTime or less after the PositioningATX LayerID.
- The ATX view of the previous epoch contains ActiveSetSize activations.
func (*Handler) UnsubscribeAtx ¶ added in v1.0.0
UnsubscribeAtx un subscribes the waiting for a specific atx with atx id id to arrive via gossip.
type MockPoetProvingServiceClient ¶ added in v1.0.0
type MockPoetProvingServiceClient struct {
// contains filtered or unexported fields
}
MockPoetProvingServiceClient is a mock of PoetProvingServiceClient interface.
func NewMockPoetProvingServiceClient ¶ added in v1.0.0
func NewMockPoetProvingServiceClient(ctrl *gomock.Controller) *MockPoetProvingServiceClient
NewMockPoetProvingServiceClient creates a new mock instance.
func (*MockPoetProvingServiceClient) EXPECT ¶ added in v1.0.0
func (m *MockPoetProvingServiceClient) EXPECT() *MockPoetProvingServiceClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPoetProvingServiceClient) PoetServiceID ¶ added in v1.0.0
func (m *MockPoetProvingServiceClient) PoetServiceID(arg0 context.Context) ([]byte, error)
PoetServiceID mocks base method.
type MockPoetProvingServiceClientMockRecorder ¶ added in v1.0.0
type MockPoetProvingServiceClientMockRecorder struct {
// contains filtered or unexported fields
}
MockPoetProvingServiceClientMockRecorder is the mock recorder for MockPoetProvingServiceClient.
func (*MockPoetProvingServiceClientMockRecorder) PoetServiceID ¶ added in v1.0.0
func (mr *MockPoetProvingServiceClientMockRecorder) PoetServiceID(arg0 interface{}) *gomock.Call
PoetServiceID indicates an expected call of PoetServiceID.
func (*MockPoetProvingServiceClientMockRecorder) Submit ¶ added in v1.0.0
func (mr *MockPoetProvingServiceClientMockRecorder) Submit(ctx, challenge, signature interface{}) *gomock.Call
Submit indicates an expected call of Submit.
type MockSmeshingProvider ¶ added in v1.0.0
type MockSmeshingProvider struct {
// contains filtered or unexported fields
}
MockSmeshingProvider is a mock of SmeshingProvider interface.
func NewMockSmeshingProvider ¶ added in v1.0.0
func NewMockSmeshingProvider(ctrl *gomock.Controller) *MockSmeshingProvider
NewMockSmeshingProvider creates a new mock instance.
func (*MockSmeshingProvider) Coinbase ¶ added in v1.0.0
func (m *MockSmeshingProvider) Coinbase() types.Address
Coinbase mocks base method.
func (*MockSmeshingProvider) EXPECT ¶ added in v1.0.0
func (m *MockSmeshingProvider) EXPECT() *MockSmeshingProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSmeshingProvider) SetCoinbase ¶ added in v1.0.0
func (m *MockSmeshingProvider) SetCoinbase(arg0 types.Address)
SetCoinbase mocks base method.
func (*MockSmeshingProvider) SmesherID ¶ added in v1.0.0
func (m *MockSmeshingProvider) SmesherID() types.NodeID
SmesherID mocks base method.
func (*MockSmeshingProvider) Smeshing ¶ added in v1.0.0
func (m *MockSmeshingProvider) Smeshing() bool
Smeshing mocks base method.
func (*MockSmeshingProvider) StartSmeshing ¶ added in v1.0.0
func (m *MockSmeshingProvider) StartSmeshing(arg0 types.Address, arg1 PostSetupOpts) error
StartSmeshing mocks base method.
func (*MockSmeshingProvider) StopSmeshing ¶ added in v1.0.0
func (m *MockSmeshingProvider) StopSmeshing(arg0 bool) error
StopSmeshing mocks base method.
type MockSmeshingProviderMockRecorder ¶ added in v1.0.0
type MockSmeshingProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockSmeshingProviderMockRecorder is the mock recorder for MockSmeshingProvider.
func (*MockSmeshingProviderMockRecorder) Coinbase ¶ added in v1.0.0
func (mr *MockSmeshingProviderMockRecorder) Coinbase() *gomock.Call
Coinbase indicates an expected call of Coinbase.
func (*MockSmeshingProviderMockRecorder) SetCoinbase ¶ added in v1.0.0
func (mr *MockSmeshingProviderMockRecorder) SetCoinbase(arg0 interface{}) *gomock.Call
SetCoinbase indicates an expected call of SetCoinbase.
func (*MockSmeshingProviderMockRecorder) SmesherID ¶ added in v1.0.0
func (mr *MockSmeshingProviderMockRecorder) SmesherID() *gomock.Call
SmesherID indicates an expected call of SmesherID.
func (*MockSmeshingProviderMockRecorder) Smeshing ¶ added in v1.0.0
func (mr *MockSmeshingProviderMockRecorder) Smeshing() *gomock.Call
Smeshing indicates an expected call of Smeshing.
func (*MockSmeshingProviderMockRecorder) StartSmeshing ¶ added in v1.0.0
func (mr *MockSmeshingProviderMockRecorder) StartSmeshing(arg0, arg1 interface{}) *gomock.Call
StartSmeshing indicates an expected call of StartSmeshing.
func (*MockSmeshingProviderMockRecorder) StopSmeshing ¶ added in v1.0.0
func (mr *MockSmeshingProviderMockRecorder) StopSmeshing(arg0 interface{}) *gomock.Call
StopSmeshing indicates an expected call of StopSmeshing.
type MockatxHandler ¶ added in v1.0.0
type MockatxHandler struct {
// contains filtered or unexported fields
}
MockatxHandler is a mock of atxHandler interface.
func NewMockatxHandler ¶ added in v1.0.0
func NewMockatxHandler(ctrl *gomock.Controller) *MockatxHandler
NewMockatxHandler creates a new mock instance.
func (*MockatxHandler) AwaitAtx ¶ added in v1.0.0
func (m *MockatxHandler) AwaitAtx(id types.ATXID) chan struct{}
AwaitAtx mocks base method.
func (*MockatxHandler) EXPECT ¶ added in v1.0.0
func (m *MockatxHandler) EXPECT() *MockatxHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockatxHandler) GetPosAtxID ¶
func (m *MockatxHandler) GetPosAtxID() (types.ATXID, error)
GetPosAtxID mocks base method.
func (*MockatxHandler) UnsubscribeAtx ¶ added in v1.0.0
func (m *MockatxHandler) UnsubscribeAtx(id types.ATXID)
UnsubscribeAtx mocks base method.
type MockatxHandlerMockRecorder ¶ added in v1.0.0
type MockatxHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockatxHandlerMockRecorder is the mock recorder for MockatxHandler.
func (*MockatxHandlerMockRecorder) AwaitAtx ¶ added in v1.0.0
func (mr *MockatxHandlerMockRecorder) AwaitAtx(id interface{}) *gomock.Call
AwaitAtx indicates an expected call of AwaitAtx.
func (*MockatxHandlerMockRecorder) GetPosAtxID ¶
func (mr *MockatxHandlerMockRecorder) GetPosAtxID() *gomock.Call
GetPosAtxID indicates an expected call of GetPosAtxID.
func (*MockatxHandlerMockRecorder) UnsubscribeAtx ¶ added in v1.0.0
func (mr *MockatxHandlerMockRecorder) UnsubscribeAtx(id interface{}) *gomock.Call
UnsubscribeAtx indicates an expected call of UnsubscribeAtx.
type MockatxProvider ¶ added in v1.0.0
type MockatxProvider struct {
// contains filtered or unexported fields
}
MockatxProvider is a mock of atxProvider interface.
func NewMockatxProvider ¶ added in v1.0.0
func NewMockatxProvider(ctrl *gomock.Controller) *MockatxProvider
NewMockatxProvider creates a new mock instance.
func (*MockatxProvider) EXPECT ¶ added in v1.0.0
func (m *MockatxProvider) EXPECT() *MockatxProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockatxProvider) GetAtxHeader ¶ added in v1.0.0
func (m *MockatxProvider) GetAtxHeader(id types.ATXID) (*types.ActivationTxHeader, error)
GetAtxHeader mocks base method.
type MockatxProviderMockRecorder ¶ added in v1.0.0
type MockatxProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockatxProviderMockRecorder is the mock recorder for MockatxProvider.
func (*MockatxProviderMockRecorder) GetAtxHeader ¶ added in v1.0.0
func (mr *MockatxProviderMockRecorder) GetAtxHeader(id interface{}) *gomock.Call
GetAtxHeader indicates an expected call of GetAtxHeader.
type MockatxReceiver ¶ added in v1.7.9
type MockatxReceiver struct {
// contains filtered or unexported fields
}
MockatxReceiver is a mock of atxReceiver interface.
func NewMockatxReceiver ¶ added in v1.7.9
func NewMockatxReceiver(ctrl *gomock.Controller) *MockatxReceiver
NewMockatxReceiver creates a new mock instance.
func (*MockatxReceiver) EXPECT ¶ added in v1.7.9
func (m *MockatxReceiver) EXPECT() *MockatxReceiverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockatxReceiver) OnAtx ¶ added in v1.7.9
func (m *MockatxReceiver) OnAtx(arg0 *types.ActivationTxHeader)
OnAtx mocks base method.
type MockatxReceiverMockRecorder ¶ added in v1.7.9
type MockatxReceiverMockRecorder struct {
// contains filtered or unexported fields
}
MockatxReceiverMockRecorder is the mock recorder for MockatxReceiver.
func (*MockatxReceiverMockRecorder) OnAtx ¶ added in v1.7.9
func (mr *MockatxReceiverMockRecorder) OnAtx(arg0 interface{}) *gomock.Call
OnAtx indicates an expected call of OnAtx.
type MocklayerClock ¶ added in v1.0.0
type MocklayerClock struct {
// contains filtered or unexported fields
}
MocklayerClock is a mock of layerClock interface.
func NewMocklayerClock ¶ added in v1.0.0
func NewMocklayerClock(ctrl *gomock.Controller) *MocklayerClock
NewMocklayerClock creates a new mock instance.
func (*MocklayerClock) AwaitLayer ¶ added in v1.0.0
func (m *MocklayerClock) AwaitLayer(layerID types.LayerID) chan struct{}
AwaitLayer mocks base method.
func (*MocklayerClock) EXPECT ¶ added in v1.0.0
func (m *MocklayerClock) EXPECT() *MocklayerClockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocklayerClock) GetCurrentLayer ¶
func (m *MocklayerClock) GetCurrentLayer() types.LayerID
GetCurrentLayer mocks base method.
func (*MocklayerClock) LayerToTime ¶ added in v1.0.0
func (m *MocklayerClock) LayerToTime(arg0 types.LayerID) time.Time
LayerToTime mocks base method.
type MocklayerClockMockRecorder ¶ added in v1.0.0
type MocklayerClockMockRecorder struct {
// contains filtered or unexported fields
}
MocklayerClockMockRecorder is the mock recorder for MocklayerClock.
func (*MocklayerClockMockRecorder) AwaitLayer ¶ added in v1.0.0
func (mr *MocklayerClockMockRecorder) AwaitLayer(layerID interface{}) *gomock.Call
AwaitLayer indicates an expected call of AwaitLayer.
func (*MocklayerClockMockRecorder) GetCurrentLayer ¶
func (mr *MocklayerClockMockRecorder) GetCurrentLayer() *gomock.Call
GetCurrentLayer indicates an expected call of GetCurrentLayer.
func (*MocklayerClockMockRecorder) LayerToTime ¶ added in v1.0.0
func (mr *MocklayerClockMockRecorder) LayerToTime(arg0 interface{}) *gomock.Call
LayerToTime indicates an expected call of LayerToTime.
type MocknipostBuilder ¶ added in v1.0.0
type MocknipostBuilder struct {
// contains filtered or unexported fields
}
MocknipostBuilder is a mock of nipostBuilder interface.
func NewMocknipostBuilder ¶ added in v1.0.0
func NewMocknipostBuilder(ctrl *gomock.Controller) *MocknipostBuilder
NewMocknipostBuilder creates a new mock instance.
func (*MocknipostBuilder) BuildNIPost ¶ added in v1.0.0
func (m *MocknipostBuilder) BuildNIPost(ctx context.Context, challenge *types.PoetChallenge, poetProofDeadline time.Time) (*types.NIPost, time.Duration, error)
BuildNIPost mocks base method.
func (*MocknipostBuilder) EXPECT ¶ added in v1.0.0
func (m *MocknipostBuilder) EXPECT() *MocknipostBuilderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MocknipostBuilderMockRecorder ¶ added in v1.0.0
type MocknipostBuilderMockRecorder struct {
// contains filtered or unexported fields
}
MocknipostBuilderMockRecorder is the mock recorder for MocknipostBuilder.
func (*MocknipostBuilderMockRecorder) BuildNIPost ¶ added in v1.0.0
func (mr *MocknipostBuilderMockRecorder) BuildNIPost(ctx, challenge, poetProofDeadline interface{}) *gomock.Call
BuildNIPost indicates an expected call of BuildNIPost.
type MocknipostValidator ¶ added in v1.0.0
type MocknipostValidator struct {
// contains filtered or unexported fields
}
MocknipostValidator is a mock of nipostValidator interface.
func NewMocknipostValidator ¶ added in v1.0.0
func NewMocknipostValidator(ctrl *gomock.Controller) *MocknipostValidator
NewMocknipostValidator creates a new mock instance.
func (*MocknipostValidator) EXPECT ¶ added in v1.0.0
func (m *MocknipostValidator) EXPECT() *MocknipostValidatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocknipostValidator) Validate ¶
func (m *MocknipostValidator) Validate(nodeId types.NodeID, atxId types.ATXID, NIPost *types.NIPost, expectedChallenge types.Hash32, numUnits uint32) (uint64, error)
Validate mocks base method.
func (*MocknipostValidator) ValidatePost ¶
func (m *MocknipostValidator) ValidatePost(nodeId types.NodeID, atxId types.ATXID, Post *types.Post, PostMetadata *types.PostMetadata, numUnits uint32) error
ValidatePost mocks base method.
func (*MocknipostValidator) ValidateVRFNonce ¶
func (m *MocknipostValidator) ValidateVRFNonce(nodeId types.NodeID, commitmentAtxId types.ATXID, vrfNonce *types.VRFPostIndex, PostMetadata *types.PostMetadata, numUnits uint32) error
ValidateVRFNonce mocks base method.
type MocknipostValidatorMockRecorder ¶ added in v1.0.0
type MocknipostValidatorMockRecorder struct {
// contains filtered or unexported fields
}
MocknipostValidatorMockRecorder is the mock recorder for MocknipostValidator.
func (*MocknipostValidatorMockRecorder) Validate ¶
func (mr *MocknipostValidatorMockRecorder) Validate(nodeId, atxId, NIPost, expectedChallenge, numUnits interface{}) *gomock.Call
Validate indicates an expected call of Validate.
func (*MocknipostValidatorMockRecorder) ValidatePost ¶
func (mr *MocknipostValidatorMockRecorder) ValidatePost(nodeId, atxId, Post, PostMetadata, numUnits interface{}) *gomock.Call
ValidatePost indicates an expected call of ValidatePost.
func (*MocknipostValidatorMockRecorder) ValidateVRFNonce ¶
func (mr *MocknipostValidatorMockRecorder) ValidateVRFNonce(nodeId, commitmentAtxId, vrfNonce, PostMetadata, numUnits interface{}) *gomock.Call
ValidateVRFNonce indicates an expected call of ValidateVRFNonce.
type MockpoetDbAPI ¶ added in v1.0.0
type MockpoetDbAPI struct {
// contains filtered or unexported fields
}
MockpoetDbAPI is a mock of poetDbAPI interface.
func NewMockpoetDbAPI ¶ added in v1.0.0
func NewMockpoetDbAPI(ctrl *gomock.Controller) *MockpoetDbAPI
NewMockpoetDbAPI creates a new mock instance.
func (*MockpoetDbAPI) EXPECT ¶ added in v1.0.0
func (m *MockpoetDbAPI) EXPECT() *MockpoetDbAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockpoetDbAPI) GetMembershipMap ¶
func (m *MockpoetDbAPI) GetMembershipMap(proofRef types.PoetProofRef) (map[types.Hash32]bool, error)
GetMembershipMap mocks base method.
func (*MockpoetDbAPI) GetProof ¶ added in v1.0.0
func (m *MockpoetDbAPI) GetProof(arg0 types.PoetProofRef) (*types.PoetProof, error)
GetProof mocks base method.
func (*MockpoetDbAPI) GetProofRef ¶
func (m *MockpoetDbAPI) GetProofRef(poetID []byte, roundID string) (types.PoetProofRef, error)
GetProofRef mocks base method.
type MockpoetDbAPIMockRecorder ¶ added in v1.0.0
type MockpoetDbAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockpoetDbAPIMockRecorder is the mock recorder for MockpoetDbAPI.
func (*MockpoetDbAPIMockRecorder) GetMembershipMap ¶
func (mr *MockpoetDbAPIMockRecorder) GetMembershipMap(proofRef interface{}) *gomock.Call
GetMembershipMap indicates an expected call of GetMembershipMap.
func (*MockpoetDbAPIMockRecorder) GetProof ¶ added in v1.0.0
func (mr *MockpoetDbAPIMockRecorder) GetProof(arg0 interface{}) *gomock.Call
GetProof indicates an expected call of GetProof.
func (*MockpoetDbAPIMockRecorder) GetProofRef ¶
func (mr *MockpoetDbAPIMockRecorder) GetProofRef(poetID, roundID interface{}) *gomock.Call
GetProofRef indicates an expected call of GetProofRef.
type MockpoetValidatorPersister ¶
type MockpoetValidatorPersister struct {
// contains filtered or unexported fields
}
MockpoetValidatorPersister is a mock of poetValidatorPersister interface.
func NewMockpoetValidatorPersister ¶
func NewMockpoetValidatorPersister(ctrl *gomock.Controller) *MockpoetValidatorPersister
NewMockpoetValidatorPersister creates a new mock instance.
func (*MockpoetValidatorPersister) EXPECT ¶
func (m *MockpoetValidatorPersister) EXPECT() *MockpoetValidatorPersisterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockpoetValidatorPersister) HasProof ¶
func (m *MockpoetValidatorPersister) HasProof(arg0 types.PoetProofRef) bool
HasProof mocks base method.
func (*MockpoetValidatorPersister) StoreProof ¶
func (m *MockpoetValidatorPersister) StoreProof(arg0 context.Context, arg1 types.PoetProofRef, arg2 *types.PoetProofMessage) error
StoreProof mocks base method.
type MockpoetValidatorPersisterMockRecorder ¶
type MockpoetValidatorPersisterMockRecorder struct {
// contains filtered or unexported fields
}
MockpoetValidatorPersisterMockRecorder is the mock recorder for MockpoetValidatorPersister.
func (*MockpoetValidatorPersisterMockRecorder) HasProof ¶
func (mr *MockpoetValidatorPersisterMockRecorder) HasProof(arg0 interface{}) *gomock.Call
HasProof indicates an expected call of HasProof.
func (*MockpoetValidatorPersisterMockRecorder) StoreProof ¶
func (mr *MockpoetValidatorPersisterMockRecorder) StoreProof(arg0, arg1, arg2 interface{}) *gomock.Call
StoreProof indicates an expected call of StoreProof.
func (*MockpoetValidatorPersisterMockRecorder) Validate ¶
func (mr *MockpoetValidatorPersisterMockRecorder) Validate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
Validate indicates an expected call of Validate.
type MockpostSetupProvider ¶ added in v1.0.0
type MockpostSetupProvider struct {
// contains filtered or unexported fields
}
MockpostSetupProvider is a mock of postSetupProvider interface.
func NewMockpostSetupProvider ¶ added in v1.0.0
func NewMockpostSetupProvider(ctrl *gomock.Controller) *MockpostSetupProvider
NewMockpostSetupProvider creates a new mock instance.
func (*MockpostSetupProvider) Benchmark ¶ added in v1.0.0
func (m *MockpostSetupProvider) Benchmark(p PostSetupComputeProvider) (int, error)
Benchmark mocks base method.
func (*MockpostSetupProvider) ComputeProviders ¶
func (m *MockpostSetupProvider) ComputeProviders() []PostSetupComputeProvider
ComputeProviders mocks base method.
func (*MockpostSetupProvider) Config ¶ added in v1.0.0
func (m *MockpostSetupProvider) Config() PostConfig
Config mocks base method.
func (*MockpostSetupProvider) EXPECT ¶ added in v1.0.0
func (m *MockpostSetupProvider) EXPECT() *MockpostSetupProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockpostSetupProvider) GenerateProof ¶ added in v1.0.0
func (m *MockpostSetupProvider) GenerateProof(challenge []byte) (*types.Post, *types.PostMetadata, error)
GenerateProof mocks base method.
func (*MockpostSetupProvider) LastOpts ¶ added in v1.0.0
func (m *MockpostSetupProvider) LastOpts() *PostSetupOpts
LastOpts mocks base method.
func (*MockpostSetupProvider) Reset ¶ added in v1.0.0
func (m *MockpostSetupProvider) Reset() error
Reset mocks base method.
func (*MockpostSetupProvider) StartSession ¶ added in v1.0.0
func (m *MockpostSetupProvider) StartSession(context context.Context, opts PostSetupOpts, commitmentAtx types.ATXID) error
StartSession mocks base method.
func (*MockpostSetupProvider) Status ¶ added in v1.0.0
func (m *MockpostSetupProvider) Status() *PostSetupStatus
Status mocks base method.
func (*MockpostSetupProvider) VRFNonce ¶ added in v1.0.0
func (m *MockpostSetupProvider) VRFNonce() (*types.VRFPostIndex, error)
VRFNonce mocks base method.
type MockpostSetupProviderMockRecorder ¶ added in v1.0.0
type MockpostSetupProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockpostSetupProviderMockRecorder is the mock recorder for MockpostSetupProvider.
func (*MockpostSetupProviderMockRecorder) Benchmark ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) Benchmark(p interface{}) *gomock.Call
Benchmark indicates an expected call of Benchmark.
func (*MockpostSetupProviderMockRecorder) ComputeProviders ¶
func (mr *MockpostSetupProviderMockRecorder) ComputeProviders() *gomock.Call
ComputeProviders indicates an expected call of ComputeProviders.
func (*MockpostSetupProviderMockRecorder) Config ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) Config() *gomock.Call
Config indicates an expected call of Config.
func (*MockpostSetupProviderMockRecorder) GenerateProof ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) GenerateProof(challenge interface{}) *gomock.Call
GenerateProof indicates an expected call of GenerateProof.
func (*MockpostSetupProviderMockRecorder) LastOpts ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) LastOpts() *gomock.Call
LastOpts indicates an expected call of LastOpts.
func (*MockpostSetupProviderMockRecorder) Reset ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) Reset() *gomock.Call
Reset indicates an expected call of Reset.
func (*MockpostSetupProviderMockRecorder) StartSession ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) StartSession(context, opts, commitmentAtx interface{}) *gomock.Call
StartSession indicates an expected call of StartSession.
func (*MockpostSetupProviderMockRecorder) Status ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
func (*MockpostSetupProviderMockRecorder) VRFNonce ¶ added in v1.0.0
func (mr *MockpostSetupProviderMockRecorder) VRFNonce() *gomock.Call
VRFNonce indicates an expected call of VRFNonce.
type Mocksigner ¶
type Mocksigner struct {
// contains filtered or unexported fields
}
Mocksigner is a mock of signer interface.
func NewMocksigner ¶
func NewMocksigner(ctrl *gomock.Controller) *Mocksigner
NewMocksigner creates a new mock instance.
func (*Mocksigner) EXPECT ¶
func (m *Mocksigner) EXPECT() *MocksignerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MocksignerMockRecorder ¶
type MocksignerMockRecorder struct {
// contains filtered or unexported fields
}
MocksignerMockRecorder is the mock recorder for Mocksigner.
func (*MocksignerMockRecorder) Sign ¶
func (mr *MocksignerMockRecorder) Sign(m interface{}) *gomock.Call
Sign indicates an expected call of Sign.
type Mocksyncer ¶ added in v1.0.0
type Mocksyncer struct {
// contains filtered or unexported fields
}
Mocksyncer is a mock of syncer interface.
func NewMocksyncer ¶ added in v1.0.0
func NewMocksyncer(ctrl *gomock.Controller) *Mocksyncer
NewMocksyncer creates a new mock instance.
func (*Mocksyncer) EXPECT ¶ added in v1.0.0
func (m *Mocksyncer) EXPECT() *MocksyncerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*Mocksyncer) RegisterForATXSynced ¶ added in v1.0.0
func (m *Mocksyncer) RegisterForATXSynced() chan struct{}
RegisterForATXSynced mocks base method.
type MocksyncerMockRecorder ¶ added in v1.0.0
type MocksyncerMockRecorder struct {
// contains filtered or unexported fields
}
MocksyncerMockRecorder is the mock recorder for Mocksyncer.
func (*MocksyncerMockRecorder) RegisterForATXSynced ¶ added in v1.0.0
func (mr *MocksyncerMockRecorder) RegisterForATXSynced() *gomock.Call
RegisterForATXSynced indicates an expected call of RegisterForATXSynced.
type NIPostBuilder ¶ added in v1.0.0
type NIPostBuilder struct {
// contains filtered or unexported fields
}
NIPostBuilder holds the required state and dependencies to create Non-Interactive Proofs of Space-Time (NIPost).
func NewNIPostBuilder ¶ added in v1.0.0
func NewNIPostBuilder( minerID types.NodeID, postSetupProvider postSetupProvider, poetProvers []PoetProvingServiceClient, poetDB poetDbAPI, db *sql.Database, log log.Log, signer signing.Signer, ) *NIPostBuilder
NewNIPostBuilder returns a NIPostBuilder.
func (*NIPostBuilder) BuildNIPost ¶ added in v1.0.0
func (nb *NIPostBuilder) BuildNIPost(ctx context.Context, challenge *types.PoetChallenge, poetProofDeadline time.Time) (*types.NIPost, time.Duration, error)
BuildNIPost uses the given challenge to build a NIPost. The process can take considerable time, because it includes waiting for the poet service to publish a proof - a process that takes about an epoch.
type PoETClientInitializer ¶ added in v1.0.0
type PoETClientInitializer func(string) PoetProvingServiceClient
PoETClientInitializer interfaces for creating PoetProvingServiceClient.
type PoetConfig ¶ added in v1.0.0
type PoetConfig struct { PhaseShift time.Duration `mapstructure:"phase-shift"` CycleGap time.Duration `mapstructure:"cycle-gap"` GracePeriod time.Duration `mapstructure:"grace-period"` }
PoetConfig is the configuration to interact with the poet server.
func DefaultPoetConfig ¶ added in v1.0.0
func DefaultPoetConfig() PoetConfig
type PoetDb ¶
type PoetDb struct {
// contains filtered or unexported fields
}
PoetDb is a database for PoET proofs.
func (*PoetDb) GetMembershipMap ¶
GetMembershipMap returns the map of memberships in the requested PoET proof.
func (*PoetDb) GetProofMessage ¶
func (db *PoetDb) GetProofMessage(proofRef types.PoetProofRef) ([]byte, error)
GetProofMessage returns the originally received PoET proof message.
func (*PoetDb) GetProofRef ¶ added in v1.0.0
func (*PoetDb) HasProof ¶
func (db *PoetDb) HasProof(proofRef types.PoetProofRef) bool
HasProof returns true if the database contains a proof with the given reference, or false otherwise.
func (*PoetDb) StoreProof ¶ added in v1.0.0
func (db *PoetDb) StoreProof(ctx context.Context, ref types.PoetProofRef, proofMessage *types.PoetProofMessage) error
StoreProof saves the poet proof in local db.
func (*PoetDb) Validate ¶
func (db *PoetDb) Validate(proof types.PoetProof, poetID []byte, roundID string, signature []byte) error
Validate validates a new PoET proof.
func (*PoetDb) ValidateAndStore ¶
ValidateAndStore validates and stores a new PoET proof.
type PoetListener ¶
type PoetListener struct {
// contains filtered or unexported fields
}
PoetListener handles PoET gossip messages.
func NewPoetListener ¶
func NewPoetListener(poetDb poetValidatorPersister, logger log.Log) *PoetListener
NewPoetListener returns a new PoetListener.
func (*PoetListener) HandlePoetProofMessage ¶
func (l *PoetListener) HandlePoetProofMessage(ctx context.Context, _ p2p.Peer, msg []byte) pubsub.ValidationResult
HandlePoetProofMessage is a receiver for broadcast messages.
type PoetProvingServiceClient ¶
type PoetProvingServiceClient interface { // Submit registers a challenge in the proving service current open round. Submit(ctx context.Context, challenge []byte, signature []byte) (*types.PoetRound, error) // PoetServiceID returns the public key of the PoET proving service. PoetServiceID(context.Context) ([]byte, error) }
PoetProvingServiceClient provides a gateway to a trust-less public proving service, which may serve many PoET proving clients, and thus enormously reduce the cost-per-proof for PoET since each additional proof adds only a small number of hash evaluations to the total cost.
type PoetSvcUnstableError ¶ added in v1.0.0
type PoetSvcUnstableError struct {
// contains filtered or unexported fields
}
PoetSvcUnstableError means there was a problem communicating with a Poet service. It wraps the source error.
func (*PoetSvcUnstableError) Error ¶ added in v1.0.0
func (e *PoetSvcUnstableError) Error() string
func (*PoetSvcUnstableError) Is ¶ added in v1.0.0
func (e *PoetSvcUnstableError) Is(target error) bool
func (*PoetSvcUnstableError) Unwrap ¶ added in v1.0.0
func (e *PoetSvcUnstableError) Unwrap() error
type PostConfig ¶ added in v1.0.0
type PostConfig struct { MinNumUnits uint32 `mapstructure:"post-min-numunits"` MaxNumUnits uint32 `mapstructure:"post-max-numunits"` BitsPerLabel uint8 `mapstructure:"post-bits-per-label"` LabelsPerUnit uint64 `mapstructure:"post-labels-per-unit"` K1 uint32 `mapstructure:"post-k1"` K2 uint32 `mapstructure:"post-k2"` }
PostConfig is the configuration of the Post protocol, used for data creation, proofs generation and validation.
func DefaultPostConfig ¶ added in v1.0.0
func DefaultPostConfig() PostConfig
DefaultPostConfig defines the default configuration for Post.
type PostSetupComputeProvider ¶
type PostSetupComputeProvider initialization.ComputeProvider
PostSetupComputeProvider represent a compute provider for Post setup data creation.
type PostSetupManager ¶ added in v1.0.0
type PostSetupManager struct {
// contains filtered or unexported fields
}
PostSetupManager implements the PostProvider interface.
func NewPostSetupManager ¶ added in v1.0.0
func NewPostSetupManager(id types.NodeID, cfg PostConfig, logger log.Log, db *datastore.CachedDB, goldenATXID types.ATXID) (*PostSetupManager, error)
NewPostSetupManager creates a new instance of PostSetupManager.
func (*PostSetupManager) Benchmark ¶ added in v1.0.0
func (mgr *PostSetupManager) Benchmark(p PostSetupComputeProvider) (int, error)
Benchmark runs a short benchmarking session for a given provider to evaluate its performance.
func (*PostSetupManager) BestProvider ¶ added in v1.0.0
func (mgr *PostSetupManager) BestProvider() (*PostSetupComputeProvider, error)
BestProvider returns the most performant compute provider based on a short benchmarking session.
func (*PostSetupManager) ComputeProviders ¶
func (*PostSetupManager) ComputeProviders() []PostSetupComputeProvider
ComputeProviders returns a list of available compute providers for Post setup.
func (*PostSetupManager) Config ¶ added in v1.0.0
func (mgr *PostSetupManager) Config() PostConfig
Config returns the Post protocol config.
func (*PostSetupManager) GenerateProof ¶ added in v1.0.0
func (mgr *PostSetupManager) GenerateProof(challenge []byte) (*types.Post, *types.PostMetadata, error)
GenerateProof generates a new Post.
func (*PostSetupManager) LastOpts ¶ added in v1.0.0
func (mgr *PostSetupManager) LastOpts() *PostSetupOpts
LastOpts returns the Post setup last session options.
func (*PostSetupManager) Reset ¶ added in v1.0.0
func (mgr *PostSetupManager) Reset() error
Reset deletes the data file(s).
func (*PostSetupManager) StartSession ¶ added in v1.0.0
func (mgr *PostSetupManager) StartSession(ctx context.Context, opts PostSetupOpts, commitmentAtx types.ATXID) error
StartSession starts (or continues) a data creation session. It supports resuming a previously started session, as well as changing the Post setup options (e.g., number of units) after initial setup.
func (*PostSetupManager) Status ¶ added in v1.0.0
func (mgr *PostSetupManager) Status() *PostSetupStatus
Status returns the setup current status.
func (*PostSetupManager) VRFNonce ¶ added in v1.0.0
func (mgr *PostSetupManager) VRFNonce() (*types.VRFPostIndex, error)
VRFNonce returns the VRF nonce found during initialization.
type PostSetupOpts ¶ added in v1.0.0
type PostSetupOpts struct { DataDir string `mapstructure:"smeshing-opts-datadir"` NumUnits uint32 `mapstructure:"smeshing-opts-numunits"` NumFiles uint32 `mapstructure:"smeshing-opts-numfiles"` ComputeProviderID int `mapstructure:"smeshing-opts-provider"` Throttle bool `mapstructure:"smeshing-opts-throttle"` }
PostSetupOpts are the options used to initiate a Post setup data creation session, either via the public smesher API, or on node launch (via cmd args).
func DefaultPostSetupOpts ¶ added in v1.0.0
func DefaultPostSetupOpts() PostSetupOpts
DefaultPostSetupOpts defines the default options for Post setup.
type PostSetupState ¶ added in v1.0.0
type PostSetupState int32
const ( PostSetupStateNotStarted PostSetupState = 1 + iota PostSetupStateInProgress PostSetupStateStopped PostSetupStateComplete PostSetupStateError )
type PostSetupStatus ¶ added in v1.0.0
type PostSetupStatus struct { State PostSetupState NumLabelsWritten uint64 LastOpts *PostSetupOpts }
PostSetupStatus represents a status snapshot of the Post setup.
type SmeshingProvider ¶ added in v1.0.0
type SmeshingProvider interface { Smeshing() bool StartSmeshing(types.Address, PostSetupOpts) error StopSmeshing(bool) error SmesherID() types.NodeID Coinbase() types.Address SetCoinbase(coinbase types.Address) }
SmeshingProvider defines the functionality required for the node's Smesher API.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator contains the dependencies required to validate NIPosts.
func NewValidator ¶
func NewValidator(poetDb poetDbAPI, cfg PostConfig) *Validator
NewValidator returns a new NIPost validator.
func (*Validator) Validate ¶
func (v *Validator) Validate(nodeId types.NodeID, commitmentAtxId types.ATXID, nipost *types.NIPost, expectedChallenge types.Hash32, numUnits uint32) (uint64, error)
Validate validates a NIPost, given a miner id and expected challenge. It returns an error if an issue is found or nil if the NIPost is valid. Some of the Post metadata fields validation values is ought to eventually be derived from consensus instead of local configuration. If so, their validation should be removed to contextual validation, while still syntactically-validate them here according to locally configured min/max values.
func (*Validator) ValidatePost ¶
func (*Validator) ValidatePost(nodeId types.NodeID, commitmentAtxId types.ATXID, PoST *types.Post, PostMetadata *types.PostMetadata, numUnits uint32) error
ValidatePost validates a Proof of Space-Time (PoST). It returns nil if validation passed or an error indicating why validation failed.
func (*Validator) ValidateVRFNonce ¶
type VerifyError ¶
type VerifyError struct {
// contains filtered or unexported fields
}
func (*VerifyError) Error ¶
func (e *VerifyError) Error() string
func (*VerifyError) Is ¶
func (e *VerifyError) Is(target error) bool
func (*VerifyError) Unwrap ¶
func (e *VerifyError) Unwrap() error