Job Declaration Documentation#1265
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1265 +/- ##
=======================================
Coverage 19.30% 19.30%
=======================================
Files 164 164
Lines 10849 10849
=======================================
Hits 2094 2094
Misses 8755 8755
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
| Branch | 2024-11-08-job-declaration-msgs-docs |
| Testbed | sv2 |
🚨 3 Alerts
| Benchmark | Measure Units | View | Benchmark Result (Result Δ%) | Upper Boundary (Limit %) |
|---|---|---|---|---|
| client_sv2_handle_message_mining | Estimated Cycles estimated cycles | 📈 plot 🚨 alert (🔔) 🚷 threshold | 8,306.00 (+1.23%) | 8,303.22 (100.03%) |
| client_sv2_handle_message_mining | RAM Accesses accesses | 📈 plot 🚨 alert (🔔) 🚷 threshold | 142.00 (+2.11%) | 141.60 (100.28%) |
| client_sv2_mining_message_submit_standard_serialize_deserialize | L2 Accesses accesses | 📈 plot 🚨 alert (🔔) 🚷 threshold | 93.00 (+13.91%) | 91.60 (101.53%) |
Click to view all benchmark results
| Benchmark | Estimated Cycles | Benchmark Result estimated cycles (Result Δ%) | Upper Boundary estimated cycles (Limit %) | Instructions | Benchmark Result instructions (Result Δ%) | Upper Boundary instructions (Limit %) | L1 Accesses | Benchmark Result accesses (Result Δ%) | Upper Boundary accesses (Limit %) | L2 Accesses | Benchmark Result accesses (Result Δ%) | Upper Boundary accesses (Limit %) | RAM Accesses | Benchmark Result accesses (Result Δ%) | Upper Boundary accesses (Limit %) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| client_sv2_handle_message_common | 📈 view plot 🚷 view threshold | 2,121.00 (+1.09%) | 2,215.51 (95.73%) | 📈 view plot 🚷 view threshold | 473.00 (-0.06%) | 488.67 (96.79%) | 📈 view plot 🚷 view threshold | 736.00 (+0.02%) | 757.48 (97.16%) | 📈 view plot 🚷 view threshold | 4.00 (-24.04%) | 13.51 (29.61%) | 📈 view plot 🚷 view threshold | 39.00 (+2.17%) | 41.40 (94.20%) |
| client_sv2_handle_message_mining | 📈 view plot 🚨 view alert (🔔) 🚷 view threshold | 8,306.00 (+1.23%) | 8,303.22 (100.03%) | 📈 view plot 🚷 view threshold | 2,137.00 (-0.03%) | 2,143.08 (99.72%) | 📈 view plot 🚷 view threshold | 3,156.00 (-0.15%) | 3,170.85 (99.53%) | 📈 view plot 🚷 view threshold | 36.00 (+1.65%) | 41.57 (86.60%) | 📈 view plot 🚨 view alert (🔔) 🚷 view threshold | 142.00 (+2.11%) | 141.60 (100.28%) |
| client_sv2_mining_message_submit_standard | 📈 view plot 🚷 view threshold | 6,345.00 (+0.98%) | 6,409.55 (98.99%) | 📈 view plot 🚷 view threshold | 1,750.00 (-0.05%) | 1,767.03 (99.04%) | 📈 view plot 🚷 view threshold | 2,550.00 (-0.13%) | 2,575.88 (99.00%) | 📈 view plot 🚷 view threshold | 17.00 (+0.55%) | 24.22 (70.20%) | 📈 view plot 🚷 view threshold | 106.00 (+1.76%) | 107.67 (98.45%) |
| client_sv2_mining_message_submit_standard_serialize | 📈 view plot 🚷 view threshold | 14,804.00 (+0.52%) | 14,948.37 (99.03%) | 📈 view plot 🚷 view threshold | 4,694.00 (-0.02%) | 4,711.03 (99.64%) | 📈 view plot 🚷 view threshold | 6,749.00 (-0.14%) | 6,783.12 (99.50%) | 📈 view plot 🚷 view threshold | 50.00 (+14.63%) | 54.56 (91.64%) | 📈 view plot 🚷 view threshold | 223.00 (+0.71%) | 227.23 (98.14%) |
| client_sv2_mining_message_submit_standard_serialize_deserialize | 📈 view plot 🚷 view threshold | 27,796.00 (+0.92%) | 27,862.42 (99.76%) | 📈 view plot 🚷 view threshold | 10,645.00 (+0.55%) | 10,663.08 (99.83%) | 📈 view plot 🚷 view threshold | 15,501.00 (+0.61%) | 15,530.80 (99.81%) | 📈 view plot 🚨 view alert (🔔) 🚷 view threshold | 93.00 (+13.91%) | 91.60 (101.53%) | 📈 view plot 🚷 view threshold | 338.00 (+0.87%) | 341.75 (98.90%) |
| client_sv2_open_channel | 📈 view plot 🚷 view threshold | 4,443.00 (+1.15%) | 4,586.68 (96.87%) | 📈 view plot 🚷 view threshold | 1,461.00 (-0.02%) | 1,476.67 (98.94%) | 📈 view plot 🚷 view threshold | 2,158.00 (-0.10%) | 2,184.21 (98.80%) | 📈 view plot 🚷 view threshold | 9.00 (+3.60%) | 16.53 (54.43%) | 📈 view plot 🚷 view threshold | 64.00 (+2.34%) | 67.82 (94.37%) |
| client_sv2_open_channel_serialize | 📈 view plot 🚷 view threshold | 14,032.00 (-0.07%) | 14,351.53 (97.77%) | 📈 view plot 🚷 view threshold | 5,064.00 (-0.01%) | 5,079.67 (99.69%) | 📈 view plot 🚷 view threshold | 7,322.00 (-0.06%) | 7,351.70 (99.60%) | 📈 view plot 🚷 view threshold | 40.00 (+13.60%) | 44.19 (90.51%) | 📈 view plot 🚷 view threshold | 186.00 (-0.45%) | 195.78 (95.01%) |
| client_sv2_open_channel_serialize_deserialize | 📈 view plot 🚷 view threshold | 22,824.00 (+0.70%) | 22,932.56 (99.53%) | 📈 view plot 🚷 view threshold | 8,040.00 (+0.20%) | 8,071.27 (99.61%) | 📈 view plot 🚷 view threshold | 11,689.00 (+0.14%) | 11,746.26 (99.51%) | 📈 view plot 🚷 view threshold | 85.00 (+14.03%) | 85.61 (99.29%) | 📈 view plot 🚷 view threshold | 306.00 (+0.84%) | 310.97 (98.40%) |
| client_sv2_setup_connection | 📈 view plot 🚷 view threshold | 4,707.00 (+0.45%) | 4,780.05 (98.47%) | 📈 view plot 🚷 view threshold | 1,502.00 (-0.02%) | 1,517.67 (98.97%) | 📈 view plot 🚷 view threshold | 2,277.00 (-0.06%) | 2,299.30 (99.03%) | 📈 view plot 🚷 view threshold | 10.00 (+4.40%) | 16.56 (60.37%) | 📈 view plot 🚷 view threshold | 68.00 (+0.87%) | 69.96 (97.20%) |
| client_sv2_setup_connection_serialize | 📈 view plot 🚷 view threshold | 16,206.00 (+0.26%) | 16,425.09 (98.67%) | 📈 view plot 🚷 view threshold | 5,963.00 (-0.01%) | 5,978.67 (99.74%) | 📈 view plot 🚷 view threshold | 8,656.00 (-0.09%) | 8,691.59 (99.59%) | 📈 view plot 🚷 view threshold | 47.00 (+17.96%) | 53.15 (88.43%) | 📈 view plot 🚷 view threshold | 209.00 (+0.20%) | 215.41 (97.02%) |
| client_sv2_setup_connection_serialize_deserialize | 📈 view plot 🚷 view threshold | 35,744.00 (+0.52%) | 35,809.13 (99.82%) | 📈 view plot 🚷 view threshold | 14,888.00 (+0.23%) | 14,911.57 (99.84%) | 📈 view plot 🚷 view threshold | 21,869.00 (+0.21%) | 21,923.27 (99.75%) | 📈 view plot 🚷 view threshold | 108.00 (+17.18%) | 111.22 (97.10%) | 📈 view plot 🚷 view threshold | 381.00 (+0.44%) | 385.06 (98.95%) |
|
| Branch | 2024-11-08-job-declaration-msgs-docs |
| Testbed | sv1 |
Click to view all benchmark results
| Benchmark | Estimated Cycles | Benchmark Result estimated cycles (Result Δ%) | Upper Boundary estimated cycles (Limit %) | Instructions | Benchmark Result instructions (Result Δ%) | Upper Boundary instructions (Limit %) | L1 Accesses | Benchmark Result accesses (Result Δ%) | Upper Boundary accesses (Limit %) | L2 Accesses | Benchmark Result accesses (Result Δ%) | Upper Boundary accesses (Limit %) | RAM Accesses | Benchmark Result accesses (Result Δ%) | Upper Boundary accesses (Limit %) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| get_authorize | 📈 view plot 🚷 view threshold | 8,418.00 (-0.55%) | 8,731.23 (96.41%) | 📈 view plot 🚷 view threshold | 3,663.00 (-2.23%) | 3,864.35 (94.79%) | 📈 view plot 🚷 view threshold | 5,108.00 (-2.74%) | 5,440.89 (93.88%) | 📈 view plot 🚷 view threshold | 11.00 (+49.63%) | 13.88 (79.27%) | 📈 view plot 🚷 view threshold | 93.00 (+2.49%) | 95.53 (97.35%) |
| get_submit | 📈 view plot 🚷 view threshold | 95,332.00 (-0.10%) | 95,882.53 (99.43%) | 📈 view plot 🚷 view threshold | 59,263.00 (-0.32%) | 59,703.41 (99.26%) | 📈 view plot 🚷 view threshold | 85,072.00 (-0.38%) | 85,796.68 (99.16%) | 📈 view plot 🚷 view threshold | 50.00 (+11.93%) | 62.77 (79.66%) | 📈 view plot 🚷 view threshold | 286.00 (+2.05%) | 289.88 (98.66%) |
| get_subscribe | 📈 view plot 🚷 view threshold | 7,931.00 (-1.11%) | 8,276.94 (95.82%) | 📈 view plot 🚷 view threshold | 2,758.00 (-2.62%) | 2,943.14 (93.71%) | 📈 view plot 🚷 view threshold | 3,831.00 (-3.19%) | 4,131.71 (92.72%) | 📈 view plot 🚷 view threshold | 15.00 (+25.41%) | 20.61 (72.79%) | 📈 view plot 🚷 view threshold | 115.00 (+0.55%) | 118.61 (96.96%) |
| serialize_authorize | 📈 view plot 🚷 view threshold | 12,207.00 (-0.62%) | 12,566.06 (97.14%) | 📈 view plot 🚷 view threshold | 5,240.00 (-1.47%) | 5,431.16 (96.48%) | 📈 view plot 🚷 view threshold | 7,277.00 (-1.86%) | 7,598.20 (95.77%) | 📈 view plot 🚷 view threshold | 13.00 (+40.90%) | 16.76 (77.54%) | 📈 view plot 🚷 view threshold | 139.00 (+0.90%) | 142.68 (97.42%) |
| serialize_deserialize_authorize | 📈 view plot 🚷 view threshold | 24,640.00 (-0.23%) | 25,215.77 (97.72%) | 📈 view plot 🚷 view threshold | 9,786.00 (-1.03%) | 10,041.04 (97.46%) | 📈 view plot 🚷 view threshold | 13,785.00 (-1.24%) | 14,201.55 (97.07%) | 📈 view plot 🚷 view threshold | 36.00 (+3.81%) | 43.72 (82.35%) | 📈 view plot 🚷 view threshold | 305.00 (+1.03%) | 314.91 (96.85%) |
| serialize_deserialize_handle_authorize | 📈 view plot 🚷 view threshold | 30,223.00 (-0.34%) | 30,747.36 (98.29%) | 📈 view plot 🚷 view threshold | 11,989.00 (-0.74%) | 12,208.71 (98.20%) | 📈 view plot 🚷 view threshold | 16,953.00 (-0.88%) | 17,305.52 (97.96%) | 📈 view plot 🚷 view threshold | 57.00 (+2.49%) | 67.60 (84.33%) | 📈 view plot 🚷 view threshold | 371.00 (+0.30%) | 381.42 (97.27%) |
| serialize_deserialize_handle_submit | 📈 view plot 🚷 view threshold | 126,434.00 (-0.03%) | 126,894.42 (99.64%) | 📈 view plot 🚷 view threshold | 73,117.00 (-0.23%) | 73,523.60 (99.45%) | 📈 view plot 🚷 view threshold | 104,759.00 (-0.28%) | 105,463.84 (99.33%) | 📈 view plot 🚷 view threshold | 114.00 (+6.74%) | 131.65 (86.59%) | 📈 view plot 🚷 view threshold | 603.00 (+1.05%) | 606.28 (99.46%) |
| serialize_deserialize_handle_subscribe | 📈 view plot 🚷 view threshold | 27,829.00 (-0.09%) | 28,582.50 (97.36%) | 📈 view plot 🚷 view threshold | 9,577.00 (-0.73%) | 9,756.68 (98.16%) | 📈 view plot 🚷 view threshold | 13,519.00 (-0.91%) | 13,816.72 (97.85%) | 📈 view plot 🚷 view threshold | 69.00 (+8.46%) | 76.31 (90.42%) | 📈 view plot 🚷 view threshold | 399.00 (+0.53%) | 416.31 (95.84%) |
| serialize_deserialize_submit | 📈 view plot 🚷 view threshold | 115,185.00 (-0.06%) | 115,786.72 (99.48%) | 📈 view plot 🚷 view threshold | 67,894.00 (-0.30%) | 68,410.04 (99.25%) | 📈 view plot 🚷 view threshold | 97,355.00 (-0.38%) | 98,253.47 (99.09%) | 📈 view plot 🚷 view threshold | 73.00 (+16.05%) | 79.50 (91.82%) | 📈 view plot 🚷 view threshold | 499.00 (+1.49%) | 499.89 (99.82%) |
| serialize_deserialize_subscribe | 📈 view plot 🚷 view threshold | 23,240.00 (-0.15%) | 23,964.96 (96.97%) | 📈 view plot 🚷 view threshold | 8,129.00 (-0.90%) | 8,312.98 (97.79%) | 📈 view plot 🚷 view threshold | 11,425.00 (-1.11%) | 11,724.75 (97.44%) | 📈 view plot 🚷 view threshold | 39.00 (+4.37%) | 44.92 (86.82%) | 📈 view plot 🚷 view threshold | 332.00 (+0.74%) | 347.15 (95.64%) |
| serialize_submit | 📈 view plot 🚷 view threshold | 99,789.00 (-0.06%) | 100,299.12 (99.49%) | 📈 view plot 🚷 view threshold | 61,325.00 (-0.28%) | 61,734.50 (99.34%) | 📈 view plot 🚷 view threshold | 87,929.00 (-0.35%) | 88,628.91 (99.21%) | 📈 view plot 🚷 view threshold | 55.00 (+17.53%) | 64.81 (84.86%) | 📈 view plot 🚷 view threshold | 331.00 (+1.86%) | 334.77 (98.87%) |
| serialize_subscribe | 📈 view plot 🚷 view threshold | 11,410.00 (+0.02%) | 11,678.44 (97.70%) | 📈 view plot 🚷 view threshold | 4,111.00 (-1.65%) | 4,285.77 (95.92%) | 📈 view plot 🚷 view threshold | 5,690.00 (-2.14%) | 5,984.68 (95.08%) | 📈 view plot 🚷 view threshold | 17.00 (+31.32%) | 21.27 (79.93%) | 📈 view plot 🚷 view threshold | 161.00 (+1.93%) | 163.62 (98.40%) |
|
| Branch | 2024-11-08-job-declaration-msgs-docs |
| Testbed | sv2 |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result nanoseconds (ns) (Result Δ%) | Upper Boundary nanoseconds (ns) (Limit %) |
|---|---|---|---|
| client_sv2_handle_message_common | 📈 view plot 🚷 view threshold | 45.17 (+1.41%) | 46.97 (96.16%) |
| client_sv2_handle_message_mining | 📈 view plot 🚷 view threshold | 78.50 (+3.60%) | 90.33 (86.91%) |
| client_sv2_mining_message_submit_standard | 📈 view plot 🚷 view threshold | 14.66 (-0.04%) | 14.79 (99.10%) |
| client_sv2_mining_message_submit_standard_serialize | 📈 view plot 🚷 view threshold | 268.83 (+1.97%) | 302.41 (88.90%) |
| client_sv2_mining_message_submit_standard_serialize_deserialize | 📈 view plot 🚷 view threshold | 617.09 (+0.42%) | 695.53 (88.72%) |
| client_sv2_open_channel | 📈 view plot 🚷 view threshold | 162.78 (+4.03%) | 197.57 (82.39%) |
| client_sv2_open_channel_serialize | 📈 view plot 🚷 view threshold | 286.13 (+0.71%) | 307.95 (92.92%) |
| client_sv2_open_channel_serialize_deserialize | 📈 view plot 🚷 view threshold | 380.04 (-0.35%) | 411.72 (92.31%) |
| client_sv2_setup_connection | 📈 view plot 🚷 view threshold | 162.72 (+1.37%) | 168.62 (96.50%) |
| client_sv2_setup_connection_serialize | 📈 view plot 🚷 view threshold | 495.51 (+4.84%) | 567.61 (87.30%) |
| client_sv2_setup_connection_serialize_deserialize | 📈 view plot 🚷 view threshold | 1,003.90 (+1.60%) | 1,110.08 (90.44%) |
| The following crate contains the messages defined in the Job Declaration Protocol of Stratum V2. | ||
| This protocol runs between the Job Declarator and Pool and can be provided as a trusted 3rd party | ||
| service for mining farms. |
There was a problem hiding this comment.
| The following crate contains the messages defined in the Job Declaration Protocol of Stratum V2. | |
| This protocol runs between the Job Declarator and Pool and can be provided as a trusted 3rd party | |
| service for mining farms. | |
| `job_declaration_sv2` is a Rust crate that implements a set of messages defined in the Job Declaration Protocol of Stratum V2. | |
| This protocol runs between the Job Declarator Server (JDS) and Job Declarator Client (JDC). |
| /// A request to get an identifier for a future-submitted mining job. | ||
| /// Rate limited to a rather slow rate and only available on connections where this has been | ||
| /// negotiated. Otherwise, only `mining_job_token(s)` from `CreateMiningJob.Success` are valid. | ||
| /// Message used by JDClient to request an identifier for a future mining job from JDServer. |
There was a problem hiding this comment.
| /// Message used by JDClient to request an identifier for a future mining job from JDServer. | |
| /// Message used by Job Declarator Client (JDC) to request an identifier for a future mining job from Job Declarator Server (JDS). |
| /// Unconstrained sequence of bytes. Whatever is needed by the JDServer to | ||
| /// identify/authenticate the client. Additional restrictions can be imposed by the | ||
| /// JDServer. It is highly recommended that UTF-8 encoding is used. |
There was a problem hiding this comment.
| /// Unconstrained sequence of bytes. Whatever is needed by the JDServer to | |
| /// identify/authenticate the client. Additional restrictions can be imposed by the | |
| /// JDServer. It is highly recommended that UTF-8 encoding is used. | |
| /// Unconstrained sequence of bytes. Whatever is needed by the JDS to | |
| /// identify/authenticate the client. Additional restrictions can be imposed by the | |
| /// JDS. It is highly recommended that UTF-8 encoding is used. |
| /// Notably, if the pool intends to change the space it requires for coinbase transaction outputs | ||
| /// regularly, it should simply prefer to use the maximum of all such output sizes as the | ||
| /// `coinbase_output_max_additional_size` value. | ||
| /// A Message used by a JDServer in response to a [`AllocateMiningJobToken`] message. |
There was a problem hiding this comment.
| /// A Message used by a JDServer in response to a [`AllocateMiningJobToken`] message. | |
| /// A message used by a JDS in response to a [`AllocateMiningJobToken`] message. |
| //! The following crate defines the set of messages used in the Job Declaration Stratum V2 | ||
| //! subprotcol. |
There was a problem hiding this comment.
| //! The following crate defines the set of messages used in the Job Declaration Stratum V2 | |
| //! subprotcol. | |
| //! This crate defines the set of messages used in the Job Declaration subprotcol of Stratum V2. |
| // position in the original DeclareMiningJob message, 0-indexed not including the coinbase | ||
| // transaction transaction. | ||
|
|
||
| /// A message used by the JDserver to ask for transactions that it did not recognize from |
There was a problem hiding this comment.
| /// A message used by the JDserver to ask for transactions that it did not recognize from | |
| /// A message used by the JDS to ask for transactions that it did not recognize from |
| /// In order to do block propagation, JDServer must know all the transactions within the current | ||
| /// block template. These transactions are provided by the JDClient to the JDserver as a sequence | ||
| /// of short hashes in the [`crate::DeclareMiningJob::tx_short_hash_list`] message. If JDserver is |
There was a problem hiding this comment.
| /// In order to do block propagation, JDServer must know all the transactions within the current | |
| /// block template. These transactions are provided by the JDClient to the JDserver as a sequence | |
| /// of short hashes in the [`crate::DeclareMiningJob::tx_short_hash_list`] message. If JDserver is | |
| /// In order to do block propagation, JDS must know all the transactions within the current | |
| /// block template. These transactions are provided by the JDC to the JDS as a sequence | |
| /// of short hashes in the [`crate::DeclareMiningJob::tx_short_hash_list`] message. If JDS is |
| /// | ||
| /// Must be the same as the received [`crate::DeclareMiningJob::request_id`]. | ||
| pub request_id: u32, | ||
| /// A list of unrecognized transactions that need to be supplied by the JDClient in full. They |
There was a problem hiding this comment.
| /// A list of unrecognized transactions that need to be supplied by the JDClient in full. They | |
| /// A list of unrecognized transactions that need to be supplied by the JDC in full. They |
| /// A message sent by JDClient as soon as it finds a valid block. | ||
| /// | ||
| /// Upon receiving this message, JDServer should propogate the new block as soon as possible. | ||
| /// | ||
| /// Note that JDClient is also expected to share the new block data through `SubmitSolution` |
There was a problem hiding this comment.
| /// A message sent by JDClient as soon as it finds a valid block. | |
| /// | |
| /// Upon receiving this message, JDServer should propogate the new block as soon as possible. | |
| /// | |
| /// Note that JDClient is also expected to share the new block data through `SubmitSolution` | |
| /// A message sent by JDC as soon as it finds a valid block. | |
| /// | |
| /// Upon receiving this message, JDS should propagate the new block as soon as possible. | |
| /// | |
| /// Note that JDC is also expected to share the new block data through `SubmitSolution` |
| /// A Token that makes the JD Client eligible for committing a mining job for | ||
| /// approval/transaction declaration or for identifying custom mining job on mining connection. |
There was a problem hiding this comment.
Have you missed this one? We always referenced to it with JDC, I've never seen JD Client
| // position in the original DeclareMiningJob message, 0-indexed not including the coinbase | ||
| // transaction transaction. | ||
|
|
||
| /// Message used by the JDserver to ask for transactions that it did not recognize from |
There was a problem hiding this comment.
| /// Message used by the JDserver to ask for transactions that it did not recognize from | |
| /// Message used by JDS to ask for transactions that it did not recognize from |
|
Rebased without further changes |
resolves #1204