Skip to content

Commit

Permalink
Merge pull request #1067 from o1-labs/al/work-selection-method
Browse files Browse the repository at this point in the history
Update with the new work selection method
  • Loading branch information
shimkiv authored Oct 28, 2024
2 parents 62c4728 + e1b3bb7 commit 20d8f81
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/berkeley-upgrade/flags-configs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mina daemon
--peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt
--run-snark-coordinator <public key>
--snark-worker-fee 0.001
--work-selection [seq|rand]
--work-selection [seq|rand|roffset]
ENVIRONMENT VARIABLES
MINA_LIBP2P_PASS
Expand Down
2 changes: 1 addition & 1 deletion docs/mina-protocol/snark-workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ We anticipate the snarketplace to dynamically rebalance — eg. follow the simpl
- if market price is X, it is likely effective to sell SNARK work for any price below X (eg. X - 1), provided it is profitable after operating expenses.
- block producers are incentivized to purchase more units of SNARK work from the same SNARK worker because there will only be one _fee transfer_ transaction they have to include in the block.
- Basically, the way a block producer pays a SNARK worker is through a special type of transaction called a fee transfer. The BP's incentive is to minimize the number of fee transfers, as each is a discrete transaction that needs to be added to a block (and consequently offset by more SNARK work). Thus, the best case scenario is to buy a bundle of SNARK work from the same SNARK worker.
- some SNARK work will be more important to complete ahead of other work, as it would free up an entire tree worth of memory (see the video above for more details). This is made possible by different work selection methods. Currently, the two methods supported natively are sequential and random. Neither of these however takes advantage of dynamic markets, which is an area of improvement that the Mina community can develop solutions for.
- some SNARK work will be more important to complete ahead of other work, as it would free up an entire tree worth of memory (see the video above for more details). This is made possible by different work selection methods. Currently, the three methods supported natively are sequential, random and sequential with a random offset. Neither of these however takes advantage of dynamic markets, which is an area of improvement that the Mina community can develop solutions for.

Since all the data around snarks and prices are public, there are several ways to inspect the snarketplace. One example is [using the GraphQL API](https://youtu.be/XQlfX-LnK_A), and other options include using the CLI, or rolling a custom solution that tracks snarks in the SNARK mempool.

Expand Down
2 changes: 1 addition & 1 deletion docs/node-operators/flags-configs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mina daemon
--peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt
--run-snark-coordinator <public key>
--snark-worker-fee 0.001
--work-selection [seq|rand]
--work-selection [seq|rand|roffset]
ENVIRONMENT VARIABLES
MINA_LIBP2P_PASS
Expand Down
8 changes: 5 additions & 3 deletions docs/node-operators/mina-cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,11 @@ Mina daemon
420000ms)
(alias:
-work-reassignment-wait)
[--work-selection seq|rand] Choose work sequentially
(seq) or randomly (rand)
(default: rand)
[--work-selection seq|rand|roffset] Choose work sequentially
(seq), randomly (rand) or
sequentially with a random
offset (roffset) (default:
rand)
(alias: -work-selection)
[--working-dir PATH] path to chdir into before
starting (useful for
Expand Down
2 changes: 1 addition & 1 deletion docs/node-operators/snark-workers/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal snark-worker --proof-level full --shutdown-on-disconnect false --daemon
To start a SNARK-worker, run `mina daemon` with these flags:

```sh
--run-snark-worker <PUBLICKEY>\ --snark-worker-fee <FEE> --work-selection <seq|rand>
--run-snark-worker <PUBLICKEY>\ --snark-worker-fee <FEE> --work-selection <seq|rand|roffset>
```

Use the `--snark-worker-parallelism` flag to set the number of threads used in snark working, this does not affect block production.
Expand Down
2 changes: 1 addition & 1 deletion docs/node-operators/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ If you are running a SNARK worker and not seeing any work being included in bloc

Sometimes high fees will be included in blocks, and this is a function of how SNARK workers select which work to complete and which work is required to be purchased by the block producer.

By default, the work selection for a SNARK worker is random. You can change this by adding the `-work-selection seq` flag to the `mina daemon` command, which will work on jobs in the order required to be included from the scan state and will likely result in your snarks being included without a potentially lengthy delay.
By default, the work selection for a SNARK worker is random. You can change this by adding the `-work-selection` flag to the `mina daemon` command: `-work-selection seq` will work on jobs in the order required to be included from the scan state and will likely result in your snarks being included without a potentially lengthy delay; `-work-selection roffset` functions similarly to the `seq` option, but it begins processing jobs from a random offset instead of starting with the first job indicated by the scan state.

For choosing fees, you can look at historical blocks to determine prices that have been bought.

Expand Down

0 comments on commit 20d8f81

Please sign in to comment.