Skip to content

Conversation

@glyh
Copy link
Member

@glyh glyh commented May 27, 2025

image

Combining Result are those stored in Pairing Pool; Combined Result are those being submitted back to the Work Selector.

@glyh glyh requested a review from a team as a code owner May 27, 2025 07:51
@glyh
Copy link
Member Author

glyh commented May 27, 2025

!ci-build-me

@@ -0,0 +1,5 @@
open Mina_wire_types

type t =
Copy link
Member Author

@glyh glyh May 27, 2025

Choose a reason for hiding this comment

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

The reason for this is

  type t = Mina_wire_types.Network_pool.Snark_pool.Diff_versioned.V2.t =
    | Add_solved_work of Work.t * Ledger_proof.t One_or_two.t Priced_proof.t
    | Empty

Is the final type in Snark_pool_diff

Copy link
Member

Choose a reason for hiding this comment

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

Could we rewrite the type without use of Mina_wire_types, instead using XX.Stable.Latest.t types.

This will be less fragile. Let me know if it's troublesome for whatever reason.

Copy link
Member Author

@glyh glyh Jun 2, 2025

Choose a reason for hiding this comment

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

This is just runtime data, I don't see good reason versioning it as it's not serialized. I'll instead put non-wire-type definition here.

Copy link
Member Author

@glyh glyh Jun 2, 2025

Choose a reason for hiding this comment

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

It seems if I refer to network_pool directly there's going to be a dependency cycle

Copy link
Member

Choose a reason for hiding this comment

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

Okay, let's leave it as is

It would be a lot of work to change it, and not much of benefit

@glyh glyh force-pushed the corvo/work-partitioner-combing-result branch from de3a8b8 to d05cc6d Compare May 27, 2025 11:39
@glyh
Copy link
Member Author

glyh commented May 27, 2025

!ci-build-me

1 similar comment
@glyh
Copy link
Member Author

glyh commented May 28, 2025

!ci-build-me

@glyh glyh force-pushed the corvo/work-partitioner-combing-result branch from 370109e to 4a6353a Compare May 28, 2025 06:31
@glyh
Copy link
Member Author

glyh commented May 28, 2025

!ci-build-me

@glyh glyh added the snark-worker-optim Snark worker optimization: make workers operate on the level of individual proofs instead of whole t label May 28, 2025
Copy link
Member

@georgeee georgeee left a comment

Choose a reason for hiding this comment

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

Please document the combining_result.mli: every type, constructor and the merge function

open Mina_wire_types

type t =
Transaction_snark_work.Statement.V2.t
Copy link
Member

Choose a reason for hiding this comment

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

We could remove the .ml file and add a stanza to dune?

@glyh
Copy link
Member Author

glyh commented May 30, 2025

!ci-build-me

@glyh glyh force-pushed the corvo/work-partitioner-combing-result branch from 4e9ef56 to 10d8bf3 Compare June 1, 2025 05:58
@glyh
Copy link
Member Author

glyh commented Jun 1, 2025

!ci-build-me

(** [Done r] indicates that the result [r] is completed, and we should
submit it to the work selector. *)
| HalfMismatch of { submitted_half : submitted_half; in_pool : half }
(** submitted work doesn't match what we have in pool. It happens when the
Copy link
Member

Choose a reason for hiding this comment

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

If this is the only reason why HalfMismatch may happen?

Maybe then we don't need the { submitted_half : submitted_half; in_pool : half }, just the constructor with no underlying fields?

Copy link
Member

Choose a reason for hiding this comment

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

Let's name it HalfAlreadyInPool?

(** submitted work doesn't match what we have in pool. It happens when the
submitting half is the same as the half in pool *)
| NoSuchHalf of
{ submitted_half : submitted_half
Copy link
Member

Choose a reason for hiding this comment

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

Why we return the submitted half? It's an argument to the call, hence if the caller needs it, it has it.

@@ -0,0 +1,5 @@
open Mina_wire_types

type t =
Copy link
Member

Choose a reason for hiding this comment

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

Could we rewrite the type without use of Mina_wire_types, instead using XX.Stable.Latest.t types.

This will be less fragile. Let me know if it's troublesome for whatever reason.

Copy link
Member

@georgeee georgeee left a comment

Choose a reason for hiding this comment

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

Approving with a few NITs

@@ -0,0 +1,5 @@
open Mina_wire_types

type t =
Copy link
Member

Choose a reason for hiding this comment

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

Okay, let's leave it as is

It would be a lot of work to change it, and not much of benefit

| HalfMismatch of { in_pool : half }
(** submitted work doesn't match what we have in pool. It happens when the
submitting half is the same as the half in pool *)
| NoSuchHalf of { spec : Snark_work_lib.Selector.Single.Spec.t One_or_two.t }
Copy link
Member

Choose a reason for hiding this comment

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

Suggest StructureMismatch for the name

(** [Done r] indicates that the result [r] is completed, and we should
submit it to the work selector. *)
| HalfMismatch of { submitted_half : submitted_half; in_pool : half }
(** submitted work doesn't match what we have in pool. It happens when the
Copy link
Member

Choose a reason for hiding this comment

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

Let's name it HalfAlreadyInPool?

~(submitted_half : submitted_half) : merge_outcome =
match (current, submitted_half) with
| Spec_only { spec = `One spec; sok_message = { fee; prover } }, `One ->
let submitted_result =
Copy link
Member

Choose a reason for hiding this comment

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

Let's move this piece of code as finalize_one function?

}
, ((`First | `Second) as submitted_half) )
when not (equal_half in_pool_half submitted_half) ->
let submitted_result =
Copy link
Member

Choose a reason for hiding this comment

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

Let's move this piece of code as finalize_two function?

@georgeee
Copy link
Member

georgeee commented Jun 2, 2025

!ci-bypass-changelog

@glyh
Copy link
Member Author

glyh commented Jun 2, 2025

!ci-build-me

@glyh
Copy link
Member Author

glyh commented Jun 2, 2025

!ci-build-me

@glyh glyh merged commit 8b14632 into compatible Jun 2, 2025
51 checks passed
@glyh glyh deleted the corvo/work-partitioner-combing-result branch June 2, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snark-worker-optim Snark worker optimization: make workers operate on the level of individual proofs instead of whole t

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants