-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
vrfv2plus: fix processor not printing proof #13207
base: develop
Are you sure you want to change the base?
Conversation
I see you updated files related to
|
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.
Well spotted!
Not spotted. Tested in production 😆 |
@@ -1162,6 +1162,25 @@ func (lsn *listenerV2) simulateFulfillment( | |||
res.proof = FromV2Proof(m["proof"].(vrf_coordinator_v2.VRFProof)) |
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.
Would it be possible to reuse this if block by making the condition:
if trr.Task.Type() == pipeline.TaskTypeVRFV2 || trr.Task.Type() == pipeline.TaskTypeVRFV2Plus {
and having an if condition around proof
if trr.Task.Type() == pipeline.TaskTypeVRFV2 {
res.proof = FromV2Proof(m["proof"].(vrf_coordinator_v2.VRFProof))
} else {
res.proof = FromV2PlusProof(m["proof"].(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof))
}
I don't see any other difference between the two code blocks and we could re-use much of the previous logic without code duplication.
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.
It's possible. But I think it's easier to read and manage if they were 2 separate blocks than if else, shared code, if else, maybe more shared code. The 2 versions while doing mostly the same thing might not necessarily have logic that is always applicable to both versions. If the bulk of the logic in the future is shared, then yes, it's better to refactor to what you suggested.
Quality Gate passedIssues Measures |
// extract the abi-encoded tx data to fulfillRandomWords from the VRF task. | ||
// that's all we need in the event of a force-fulfillment. | ||
m := trr.Result.Value.(map[string]interface{}) | ||
res.payload = m["output"].(string) | ||
res.proof = FromV2PlusProof(m["proof"].(vrf_coordinator_v2plus_interface.IVRFCoordinatorV2PlusInternalProof)) | ||
res.reqCommitment = NewRequestCommitment(m["requestCommitment"]) |
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 am not sure if this change is needed for v2plus because there is no force-fulfillment in v2plus. e.g. vrfOwnerContract is not set for v2plus jobs
No description provided.