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

Work selector: add a function to fetch user command work #16035

Open
wants to merge 2 commits into
base: compatible
Choose a base branch
from

Conversation

anne-laure-s
Copy link
Member

@anne-laure-s anne-laure-s commented Sep 11, 2024

This PR is a first step for to https://www.notion.so/o1labs/Advanced-Snark-Coordinator-Logic-for-fetching-work-f289471a34614cf18d5bc834eaaf1060.

It adds a new function in the work selection method module to select work that correspond to simple transferts.

@anne-laure-s anne-laure-s self-assigned this Sep 11, 2024
@anne-laure-s anne-laure-s requested a review from a team as a code owner September 11, 2024 15:25
@anne-laure-s anne-laure-s marked this pull request as draft September 11, 2024 15:25
@svv232 svv232 marked this pull request as ready for review September 16, 2024 15:46
@svv232
Copy link
Member

svv232 commented Sep 16, 2024

!ci-build-me

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.

This change enables a new graphql endpoint for querying specific type of work, and custom snark workers that only process user commands. I think this is a step in the right direction for a more granular snark work interface.

Note: I'm in favor of changing the transferts to transfers to stick with the english spelling.

let is_user_transaction : t -> bool = function
| Command (Signed_command _) ->
true
| Command (Zkapp_command _) | Fee_transfer _ | Coinbase _ ->
Copy link
Member

Choose a reason for hiding this comment

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

Note that a Zkapp_command is a user_transaction

Comment on lines +164 to +170
let pending_user_work_statements ~snark_pool ~fee_opt (state : State.t) =
let work_filter (witness : Inputs.Transaction_witness.t option) =
match witness with
| None ->
false
| Some witness ->
Inputs.Transaction.is_user_transaction
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand the goal here. All of the snark work needs to be done (and ideally thus should be available from the GraphQL command)

Copy link
Member

@svv232 svv232 Sep 17, 2024

Choose a reason for hiding this comment

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

I thought the goal was just too eventually filter queries based on certain characteristics i.e fetch snark work like <trait1,trait2 …> . I saw this change as poc for this concept with just signed commands. I don’t think the intention is to replace functionality for querying all work.

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.

3 participants