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

Submit snark work using graphql #16366

Open
wants to merge 1 commit into
base: compatible
Choose a base branch
from

Conversation

deepthiskumar
Copy link
Member

Explain your changes:

  • Graphql mutation to submit transaction snarks

Explain how you tested your changes:

  • Manually tested by passing generated proofs

Part of solution described in #16214 (comment)
Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them

@deepthiskumar deepthiskumar requested a review from a team as a code owner November 19, 2024 19:57
@deepthiskumar
Copy link
Member Author

!ci-build-me

@@ -901,6 +901,13 @@ let add_work t (work : Snark_worker_lib.Work.Result.t) =
(Network_pool.Snark_pool.Resource_pool.Diff.of_result work, cb)
|> Deferred.don't_wait_for

let add_work_graphql t diff =
let results_ivar = Ivar.create () in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an ivar necessary here? Can we not just bind the deferred value and return?

Copy link
Member

@svv232 svv232 Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a an Ivar push makes sense as a validation call back.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the purpose of this callback was to check the validation status and handle it appropriately for a given message.

Copy link
Member Author

@deepthiskumar deepthiskumar Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an ivar necessary here? Can we not just bind the deferred value and return?

Yes, if you want to return the status of the operation- whether the completed work was broadcasted or not.

I thought the purpose of this callback was to check the validation status and handle it appropriately for a given message.

Not sure what the discrepancy is here. The validation status is returned to the grapqhl request and as for the message, it would either be added to the pool or not

Copy link
Member

@svv232 svv232 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to clarify one point about the validation callback before we merged this. I think the testing methodology is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants