Skip to content
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

add logging for vrf output #11719

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions core/services/pipeline/task.vrfv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (t *VRFTaskV2) Type() TaskType {
return TaskTypeVRFV2
}

func (t *VRFTaskV2) Run(_ context.Context, _ logger.Logger, vars Vars, inputs []Result) (result Result, runInfo RunInfo) {
func (t *VRFTaskV2) Run(_ context.Context, lggr logger.Logger, vars Vars, inputs []Result) (result Result, runInfo RunInfo) {
if len(inputs) != 1 {
return Result{Error: ErrWrongInputCardinality}, runInfo
}
Expand Down Expand Up @@ -134,13 +134,16 @@ func (t *VRFTaskV2) Run(_ context.Context, _ logger.Logger, vars Vars, inputs []
return Result{Error: err}, runInfo
}
results := make(map[string]interface{})
results["output"] = hexutil.Encode(b)
output := hexutil.Encode(b)
results["output"] = output
// RequestID needs to be a [32]byte for EvmTxMeta.
results["requestID"] = hexutil.Encode(requestId.Bytes())

// store vrf proof and request commitment separately so they can be used in a batch fashion
results["proof"] = onChainProof
results["requestCommitment"] = rc

lggr.Debugw("Completed VRF V2 task run", "reqID", requestId.String(), "output", output)

return Result{Value: results}, runInfo
}
7 changes: 5 additions & 2 deletions core/services/pipeline/task.vrfv2plus.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (t *VRFTaskV2Plus) Type() TaskType {
return TaskTypeVRFV2Plus
}

func (t *VRFTaskV2Plus) Run(_ context.Context, _ logger.Logger, vars Vars, inputs []Result) (result Result, runInfo RunInfo) {
func (t *VRFTaskV2Plus) Run(_ context.Context, lggr logger.Logger, vars Vars, inputs []Result) (result Result, runInfo RunInfo) {
if len(inputs) != 1 {
return Result{Error: ErrWrongInputCardinality}, runInfo
}
Expand Down Expand Up @@ -142,13 +142,16 @@ func (t *VRFTaskV2Plus) Run(_ context.Context, _ logger.Logger, vars Vars, input
return Result{Error: err}, runInfo
}
results := make(map[string]interface{})
results["output"] = hexutil.Encode(b)
output := hexutil.Encode(b)
results["output"] = output
// RequestID needs to be a [32]byte for EvmTxMeta.
results["requestID"] = hexutil.Encode(requestId.Bytes())

// store vrf proof and request commitment separately so they can be used in a batch fashion
results["proof"] = onChainProof
results["requestCommitment"] = rc

lggr.Debugw("Completed VRF V2 task run", "reqID", requestId.String(), "output", output)

return Result{Value: results}, runInfo
}
Loading