Documentation ¶
Index ¶
- func ValidateExecutions(shard model.JobShard, executions []model.ExecutionState) error
- type DecrypterFunction
- type Encrypter
- type EncrypterFunction
- type ErrInsufficientExecutions
- type ErrInvalidExecutionState
- type ErrMismatchingExecution
- type ErrMissingVerificationProposal
- type Verifier
- type VerifierProvider
- type VerifierResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateExecutions ¶
func ValidateExecutions(shard model.JobShard, executions []model.ExecutionState) error
Types ¶
type DecrypterFunction ¶
type Encrypter ¶
type Encrypter struct {
// contains filtered or unexported fields
}
func NewEncrypter ¶
type EncrypterFunction ¶
type ErrInsufficientExecutions ¶
ErrInsufficientExecutions is returned when the number of executions is less than the minimum required
func NewErrInsufficientExecutions ¶
func NewErrInsufficientExecutions(id string, minCount, submittedCount int) ErrInsufficientExecutions
func (ErrInsufficientExecutions) Error ¶
func (e ErrInsufficientExecutions) Error() string
type ErrInvalidExecutionState ¶
type ErrInvalidExecutionState struct { ExecutionID model.ExecutionID State model.ExecutionStateType }
ErrInvalidExecutionState is returned when the execution state is not valid for verification
func NewErrInvalidExecutionState ¶
func NewErrInvalidExecutionState(id model.ExecutionID, state model.ExecutionStateType) ErrInvalidExecutionState
func (ErrInvalidExecutionState) Error ¶
func (e ErrInvalidExecutionState) Error() string
type ErrMismatchingExecution ¶
type ErrMismatchingExecution struct { ShardID model.ShardID ExecutionID model.ExecutionID }
ErrMismatchingExecution is returned when the execution does not match the shard
func NewErrMismatchingExecution ¶
func NewErrMismatchingExecution(shardID model.ShardID, executionID model.ExecutionID) ErrMismatchingExecution
func (ErrMismatchingExecution) Error ¶
func (e ErrMismatchingExecution) Error() string
type ErrMissingVerificationProposal ¶
type ErrMissingVerificationProposal struct {
ExecutionID model.ExecutionID
}
ErrMissingVerificationProposal is returned when the verification proposal is missing
func NewErrMissingVerificationProposal ¶
func NewErrMissingVerificationProposal(id model.ExecutionID) ErrMissingVerificationProposal
func (ErrMissingVerificationProposal) Error ¶
func (e ErrMissingVerificationProposal) Error() string
type Verifier ¶
type Verifier interface { model.Providable // compute node // // return the local file path where the output of a local execution // should live - this is called by the executor to prepare // output volumes when running a job and the publisher when uploading // the results after verification GetShardResultPath( ctx context.Context, shard model.JobShard, ) (string, error) // compute node // // the executor has completed the job and produced a local folder of results // the verifier will now "process" this local folder into the result // that will be broadcast back to the network // For example - the "resultsHash" verifier will hash the folder // and encrypt that hash with the public key of the requester GetShardProposal( ctx context.Context, shard model.JobShard, shardResultPath string, ) ([]byte, error) // requester node // // once we've decided that a job is complete - we verify the results reported // by the compute nodes - what this actually does is up to the verifier but // it's highly likely that a verifier implementation has a controller attached // and so can trigger state transitions (such as results accepted / rejected) // for each of the shards reported // // IsJobComplete must return true otherwise this function will error VerifyShard( ctx context.Context, shard model.JobShard, executions []model.ExecutionState, ) ([]VerifierResult, error) }
Verifier is an interface representing something that can verify the results of a job.
type VerifierProvider ¶
Returns a verifier that can be used to verify a job.
type VerifierResult ¶
type VerifierResult struct { Execution model.ExecutionState Verified bool }
Click to show internal directories.
Click to hide internal directories.