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

Remove short ids #1301

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open

Remove short ids #1301

wants to merge 51 commits into from

Conversation

Fi3
Copy link
Collaborator

@Fi3 Fi3 commented Dec 17, 2024

As per stratum-mining/sv2-spec#99 this PR change the implementation so that in the JD protocol full tx ids are used instead of short tx ids. It also remove the IdentifyTransaction and IdentifyTransactionSuccess messages since are not needed anymore.

it need #1248

fi3 and others added 30 commits November 26, 2024 19:20
Coinbase signature is not part of the Sv2 protocol, some pool maybe want
to use it other not. The first part of the extranonce could also be
reserved for things that are not a pool signature. This pr rename the
pool_signature field of the channel factory into additional_coinbase_script_data
and change the type from Strgin to Vec<u8>, since can be anything.
The coinbase input script additional data should be sent as part of the
extranonce_prefix and not as part of the coinbase_prefix. So that a JDC
can see what the pool want as coinbase input script additional data
without the need to observ the coinbase prefix in job constructed by the
pool.
Update the pool to use an extranonce of 16 bytes rather then 32 so that
there is enaugh space to add the additional coinbase input script data.
Right now the channel factory only support one active job at time. That
means that if we receive a share for a job right after we sent downstream
a new job that share will be invalid. Now the channel factory keep track
of the last 3 jobs, so we give time to the dowstream to receive the job
and propagate it down before stop accepting shares for older job. This
is useful, and the system can be more responsive: as soon as we
change the coinbase additional input script data we can send a new job
dowsntream without worrying of invalidating miner's shares. When the
pool receive a prev hash it immidiatly invalidate all the previous jobs,
we still want to refuse shares for stale jobs. The client can easly handle
this situation: when a pool refuse a share it should start a timer and if do
not receive a new prev hash (or already have) within n seconds it change
pool.
This commit fix 2 miner things:

When we calculate the coinbase_prefix (what we need to put in the
extended job) we need to account also for the coinbase input script
additional data that is part of the extranonce.

When we create pool channel facotry we pass an extranonce creator and an
pool signature. If the signature + extranonce are bigger then 32 bytes
we have to return an error. That cause in sv2 the extranonce can not be
longer than 32 bytes.
The translator normalize the coinbase and remove the segwit data
from the coinbase prefix and suffix. In order to do that it need to know
the extranonce len, we used a default value of 322 bytes, but the pool
could use also smalle extranonces.
 Add a method that the pool can use in order to change
 coinbase_script_additional_data of an already opened
 channel and send downstream the new extranonce_prefix
Add time buffer to fix signature verification error
Coinbase signature is not part of the Sv2 protocol, some pool maybe want
to use it other not. The first part of the extranonce could also be
reserved for things that are not a pool signature. This pr rename the
pool_signature field of the channel factory into additional_coinbase_script_data
and change the type from Strgin to Vec<u8>, since can be anything.
The coinbase input script additional data should be sent as part of the
extranonce_prefix and not as part of the coinbase_prefix. So that a JDC
can see what the pool want as coinbase input script additional data
without the need to observ the coinbase prefix in job constructed by the
pool.
Update the pool to use an extranonce of 16 bytes rather then 32 so that
there is enaugh space to add the additional coinbase input script data.
Right now the channel factory only support one active job at time. That
means that if we receive a share for a job right after we sent downstream
a new job that share will be invalid. Now the channel factory keep track
of the last 3 jobs, so we give time to the dowstream to receive the job
and propagate it down before stop accepting shares for older job. This
is useful, and the system can be more responsive: as soon as we
change the coinbase additional input script data we can send a new job
dowsntream without worrying of invalidating miner's shares. When the
pool receive a prev hash it immidiatly invalidate all the previous jobs,
we still want to refuse shares for stale jobs. The client can easly handle
this situation: when a pool refuse a share it should start a timer and if do
not receive a new prev hash (or already have) within n seconds it change
pool.
This commit fix 2 miner things:

When we calculate the coinbase_prefix (what we need to put in the
extended job) we need to account also for the coinbase input script
additional data that is part of the extranonce.

When we create pool channel facotry we pass an extranonce creator and an
pool signature. If the signature + extranonce are bigger then 32 bytes
we have to return an error. That cause in sv2 the extranonce can not be
longer than 32 bytes.
The translator normalize the coinbase and remove the segwit data
from the coinbase prefix and suffix. In order to do that it need to know
the extranonce len, we used a default value of 322 bytes, but the pool
could use also smalle extranonces.
 Add a method that the pool can use in order to change
 coinbase_script_additional_data of an already opened
 channel and send downstream the new extranonce_prefix
Copy link
Contributor

github-actions bot commented Dec 18, 2024

🐰 Bencher Report

BranchRemoveShortIds
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
44.37
(-1.80%)
58.90
(75.33%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
73.02
(-6.44%)
104.82
(69.66%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.65
(-0.06%)
14.71
(99.59%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
274.16
(+2.59%)
290.92
(94.24%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
626.94
(+2.14%)
652.22
(96.12%)
client_sv2_open_channel📈 view plot
🚷 view threshold
162.05
(-1.70%)
176.28
(91.93%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
293.57
(+2.69%)
311.70
(94.18%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
389.89
(+1.47%)
409.95
(95.11%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
168.14
(+4.79%)
173.30
(97.02%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
469.88
(-0.32%)
550.74
(85.32%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
988.56
(-0.97%)
1,144.53
(86.37%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 18, 2024

🐰 Bencher Report

BranchRemoveShortIds
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client-submit-serialize📈 view plot
🚷 view threshold
6,518.50
(-1.24%)
6,945.71
(93.85%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,360.90
(-1.23%)
7,896.48
(93.22%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
7,987.20
(-1.65%)
9,325.57
(85.65%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
852.20
(-1.57%)
941.24
(90.54%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
680.49
(+1.01%)
715.30
(95.13%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
247.82
(-0.50%)
270.43
(91.64%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
156.89
(-0.32%)
166.40
(94.29%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,373.10
(-0.18%)
6,849.45
(93.05%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
286.68
(+1.44%)
325.68
(88.02%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
738.40
(+1.57%)
776.28
(95.12%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
607.78
(+3.14%)
626.21
(97.06%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
204.54
(-0.97%)
224.08
(91.28%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 18, 2024

🐰 Bencher Report

BranchRemoveShortIds
Testbedsv2

🚨 21 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_handle_message_commonEstimated Cycles
estimated cycles
📈 plot
🚨 alert (🔔)
🚷 threshold
2,239.00
(+6.13%)
2,231.52
(100.34%)
client_sv2_handle_message_commonRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
42.00
(+8.98%)
41.69
(100.74%)
client_sv2_mining_message_submit_standardEstimated Cycles
estimated cycles
📈 plot
🚨 alert (🔔)
🚷 threshold
6,553.00
(+4.02%)
6,459.70
(101.44%)
client_sv2_mining_message_submit_standardRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
111.00
(+6.09%)
109.01
(101.83%)
client_sv2_mining_message_submit_standardL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
26.00
(+52.03%)
24.63
(105.58%)
client_sv2_mining_message_submit_standard_serialize_deserializeInstructions
instructions
📈 plot
🚨 alert (🔔)
🚷 threshold
10,749.00
(+1.38%)
10,694.12
(100.51%)
client_sv2_mining_message_submit_standard_serialize_deserializeEstimated Cycles
estimated cycles
📈 plot
🚨 alert (🔔)
🚷 threshold
28,358.00
(+2.80%)
28,050.17
(101.10%)
client_sv2_mining_message_submit_standard_serialize_deserializeRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
348.00
(+3.77%)
343.31
(101.36%)
client_sv2_mining_message_submit_standard_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
100.00
(+20.43%)
98.08
(101.96%)
client_sv2_mining_message_submit_standard_serialize_deserializeL1 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
15,678.00
(+1.59%)
15,586.62
(100.59%)
client_sv2_open_channel_serialize_deserializeInstructions
instructions
📈 plot
🚨 alert (🔔)
🚷 threshold
8,144.00
(+1.40%)
8,070.28
(100.91%)
client_sv2_open_channel_serialize_deserializeEstimated Cycles
estimated cycles
📈 plot
🚨 alert (🔔)
🚷 threshold
23,227.00
(+2.38%)
23,024.72
(100.88%)
client_sv2_open_channel_serialize_deserializeRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
312.00
(+2.76%)
311.24
(100.25%)
client_sv2_open_channel_serialize_deserializeL1 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
11,877.00
(+1.65%)
11,745.22
(101.12%)
client_sv2_setup_connection_serializeInstructions
instructions
📈 plot
🚨 alert (🔔)
🚷 threshold
5,981.00
(+0.30%)
5,979.86
(100.02%)
client_sv2_setup_connection_serializeEstimated Cycles
estimated cycles
📈 plot
🚨 alert (🔔)
🚷 threshold
16,368.00
(+1.35%)
16,318.78
(100.30%)
client_sv2_setup_connection_serializeRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
213.00
(+2.32%)
212.14
(100.41%)
client_sv2_setup_connection_serialize_deserializeInstructions
instructions
📈 plot
🚨 alert (🔔)
🚷 threshold
15,001.00
(+0.92%)
14,925.09
(100.51%)
client_sv2_setup_connection_serialize_deserializeEstimated Cycles
estimated cycles
📈 plot
🚨 alert (🔔)
🚷 threshold
36,357.00
(+2.16%)
35,963.60
(101.09%)
client_sv2_setup_connection_serialize_deserializeRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
393.00
(+3.56%)
386.29
(101.74%)
client_sv2_setup_connection_serialize_deserializeL1 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
22,062.00
(+1.01%)
21,934.02
(100.58%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
client_sv2_handle_message_common📈 view plot
🚨 view alert (🔔)
🚷 view threshold
2,239.00
(+6.13%)
2,231.52
(100.34%)
📈 view plot
🚷 view threshold
473.00
(-0.05%)
488.96
(96.74%)
📈 view plot
🚷 view threshold
729.00
(-0.90%)
757.96
(96.18%)
📈 view plot
🚷 view threshold
8.00
(+59.01%)
12.23
(65.42%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
42.00
(+8.98%)
41.69
(100.74%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8,350.00
(+1.58%)
8,384.89
(99.58%)
📈 view plot
🚷 view threshold
2,139.00
(+0.08%)
2,141.33
(99.89%)
📈 view plot
🚷 view threshold
3,155.00
(-0.14%)
3,169.85
(99.53%)
📈 view plot
🚷 view threshold
38.00
(+7.07%)
41.63
(91.28%)
📈 view plot
🚷 view threshold
143.00
(+2.49%)
144.10
(99.24%)
client_sv2_mining_message_submit_standard📈 view plot
🚨 view alert (🔔)
🚷 view threshold
6,553.00
(+4.02%)
6,459.70
(101.44%)
📈 view plot
🚷 view threshold
1,752.00
(+0.08%)
1,766.58
(99.17%)
📈 view plot
🚷 view threshold
2,538.00
(-0.54%)
2,575.27
(98.55%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
26.00
(+52.03%)
24.63
(105.58%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
111.00
(+6.09%)
109.01
(101.83%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14,941.00
(+1.46%)
14,946.94
(99.96%)
📈 view plot
🚷 view threshold
4,705.00
(+0.22%)
4,710.91
(99.87%)
📈 view plot
🚷 view threshold
6,751.00
(-0.08%)
6,785.85
(99.49%)
📈 view plot
🚷 view threshold
56.00
(+25.01%)
60.60
(92.41%)
📈 view plot
🚷 view threshold
226.00
(+2.13%)
226.72
(99.68%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚨 view alert (🔔)
🚷 view threshold
28,358.00
(+2.80%)
28,050.17
(101.10%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
10,749.00
(+1.38%)
10,694.12
(100.51%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
15,678.00
(+1.59%)
15,586.62
(100.59%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
100.00
(+20.43%)
98.08
(101.96%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
348.00
(+3.77%)
343.31
(101.36%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4,391.00
(+0.01%)
4,547.93
(96.55%)
📈 view plot
🚷 view threshold
1,461.00
(-0.02%)
1,476.96
(98.92%)
📈 view plot
🚷 view threshold
2,156.00
(-0.21%)
2,183.66
(98.73%)
📈 view plot
🚷 view threshold
13.00
(+59.23%)
14.01
(92.78%)
📈 view plot
🚷 view threshold
62.00
(-0.87%)
66.95
(92.60%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
13,978.00
(-0.28%)
14,192.75
(98.49%)
📈 view plot
🚷 view threshold
5,074.00
(+0.19%)
5,080.27
(99.88%)
📈 view plot
🚷 view threshold
7,333.00
(+0.09%)
7,351.52
(99.75%)
📈 view plot
🚷 view threshold
41.00
(+14.16%)
46.94
(87.35%)
📈 view plot
🚷 view threshold
184.00
(-1.09%)
191.05
(96.31%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚨 view alert (🔔)
🚷 view threshold
23,227.00
(+2.38%)
23,024.72
(100.88%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
8,144.00
(+1.40%)
8,070.28
(100.91%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
11,877.00
(+1.65%)
11,745.22
(101.12%)
📈 view plot
🚷 view threshold
86.00
(+14.37%)
88.18
(97.53%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
312.00
(+2.76%)
311.24
(100.25%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4,771.00
(+1.77%)
4,787.83
(99.65%)
📈 view plot
🚷 view threshold
1,502.00
(-0.02%)
1,517.96
(98.95%)
📈 view plot
🚷 view threshold
2,276.00
(-0.10%)
2,299.52
(98.98%)
📈 view plot
🚷 view threshold
9.00
(-5.26%)
15.77
(57.06%)
📈 view plot
🚷 view threshold
70.00
(+3.72%)
70.11
(99.85%)
client_sv2_setup_connection_serialize📈 view plot
🚨 view alert (🔔)
🚷 view threshold
16,368.00
(+1.35%)
16,318.78
(100.30%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
5,981.00
(+0.30%)
5,979.86
(100.02%)
📈 view plot
🚷 view threshold
8,668.00
(+0.04%)
8,691.60
(99.73%)
📈 view plot
🚷 view threshold
49.00
(+22.36%)
54.40
(90.07%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
213.00
(+2.32%)
212.14
(100.41%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚨 view alert (🔔)
🚷 view threshold
36,357.00
(+2.16%)
35,963.60
(101.09%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
15,001.00
(+0.92%)
14,925.09
(100.51%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
22,062.00
(+1.01%)
21,934.02
(100.58%)
📈 view plot
🚷 view threshold
108.00
(+16.19%)
115.34
(93.64%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
393.00
(+3.56%)
386.29
(101.74%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 18, 2024

🐰 Bencher Report

BranchRemoveShortIds
Testbedsv1

🚨 2 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
serialize_authorizeRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
143.00
(+3.72%)
142.51
(100.35%)
serialize_subscribeRAM Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
164.00
(+3.55%)
163.84
(100.10%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
get_authorize📈 view plot
🚷 view threshold
8,520.00
(+0.74%)
8,678.03
(98.18%)
📈 view plot
🚷 view threshold
3,663.00
(-1.87%)
3,862.95
(94.82%)
📈 view plot
🚷 view threshold
5,105.00
(-2.35%)
5,448.70
(93.69%)
📈 view plot
🚷 view threshold
11.00
(+36.57%)
15.58
(70.59%)
📈 view plot
🚷 view threshold
96.00
(+5.36%)
96.22
(99.77%)
get_submit📈 view plot
🚷 view threshold
95,392.00
(+0.02%)
95,704.84
(99.67%)
📈 view plot
🚷 view threshold
59,263.00
(-0.27%)
59,711.26
(99.25%)
📈 view plot
🚷 view threshold
85,072.00
(-0.31%)
85,824.20
(99.12%)
📈 view plot
🚷 view threshold
48.00
(+8.34%)
59.58
(80.56%)
📈 view plot
🚷 view threshold
288.00
(+2.69%)
290.63
(99.09%)
get_subscribe📈 view plot
🚷 view threshold
8,003.00
(-0.03%)
8,234.94
(97.18%)
📈 view plot
🚷 view threshold
2,758.00
(-2.20%)
2,943.41
(93.70%)
📈 view plot
🚷 view threshold
3,828.00
(-2.75%)
4,143.59
(92.38%)
📈 view plot
🚷 view threshold
16.00
(+31.96%)
20.11
(79.55%)
📈 view plot
🚷 view threshold
117.00
(+2.15%)
117.88
(99.25%)
serialize_authorize📈 view plot
🚷 view threshold
12,335.00
(+0.56%)
12,511.74
(98.59%)
📈 view plot
🚷 view threshold
5,240.00
(-1.24%)
5,427.64
(96.54%)
📈 view plot
🚷 view threshold
7,275.00
(-1.58%)
7,603.83
(95.68%)
📈 view plot
🚷 view threshold
11.00
(+11.83%)
18.36
(59.92%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
143.00
(+3.72%)
142.51
(100.35%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24,738.00
(+0.10%)
25,180.98
(98.24%)
📈 view plot
🚷 view threshold
9,786.00
(-0.82%)
10,021.43
(97.65%)
📈 view plot
🚷 view threshold
13,783.00
(-1.02%)
14,186.27
(97.16%)
📈 view plot
🚷 view threshold
35.00
(-1.45%)
45.46
(76.99%)
📈 view plot
🚷 view threshold
308.00
(+1.60%)
313.30
(98.31%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30,367.00
(+0.12%)
30,714.77
(98.87%)
📈 view plot
🚷 view threshold
11,989.00
(-0.58%)
12,194.50
(98.31%)
📈 view plot
🚷 view threshold
16,947.00
(-0.74%)
17,303.01
(97.94%)
📈 view plot
🚷 view threshold
59.00
(+6.05%)
67.04
(88.01%)
📈 view plot
🚷 view threshold
375.00
(+1.14%)
379.24
(98.88%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126,464.00
(+0.00%)
126,777.35
(99.75%)
📈 view plot
🚷 view threshold
73,117.00
(-0.20%)
73,527.14
(99.44%)
📈 view plot
🚷 view threshold
104,759.00
(-0.25%)
105,494.24
(99.30%)
📈 view plot
🚷 view threshold
113.00
(+6.61%)
124.79
(90.55%)
📈 view plot
🚷 view threshold
604.00
(+1.10%)
608.07
(99.33%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27,973.00
(+0.24%)
28,421.28
(98.42%)
📈 view plot
🚷 view threshold
9,577.00
(-0.63%)
9,757.99
(98.15%)
📈 view plot
🚷 view threshold
13,513.00
(-0.83%)
13,834.08
(97.68%)
📈 view plot
🚷 view threshold
71.00
(+10.69%)
77.31
(91.84%)
📈 view plot
🚷 view threshold
403.00
(+1.05%)
411.07
(98.04%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115,203.00
(-0.04%)
115,718.45
(99.55%)
📈 view plot
🚷 view threshold
67,894.00
(-0.26%)
68,417.74
(99.23%)
📈 view plot
🚷 view threshold
97,358.00
(-0.33%)
98,281.85
(99.06%)
📈 view plot
🚷 view threshold
69.00
(+7.46%)
85.08
(81.10%)
📈 view plot
🚷 view threshold
500.00
(+1.46%)
501.81
(99.64%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23,338.00
(+0.08%)
23,838.68
(97.90%)
📈 view plot
🚷 view threshold
8,129.00
(-0.77%)
8,314.37
(97.77%)
📈 view plot
🚷 view threshold
11,423.00
(-0.96%)
11,742.36
(97.28%)
📈 view plot
🚷 view threshold
38.00
(-0.98%)
49.83
(76.25%)
📈 view plot
🚷 view threshold
335.00
(+1.13%)
343.16
(97.62%)
serialize_submit📈 view plot
🚷 view threshold
99,875.00
(+0.07%)
100,156.94
(99.72%)
📈 view plot
🚷 view threshold
61,325.00
(-0.24%)
61,737.65
(99.33%)
📈 view plot
🚷 view threshold
87,930.00
(-0.29%)
88,651.56
(99.19%)
📈 view plot
🚷 view threshold
51.00
(+7.78%)
65.46
(77.91%)
📈 view plot
🚷 view threshold
334.00
(+2.71%)
335.97
(99.41%)
serialize_subscribe📈 view plot
🚷 view threshold
11,520.00
(+1.01%)
11,610.04
(99.22%)
📈 view plot
🚷 view threshold
4,111.00
(-1.39%)
4,283.68
(95.97%)
📈 view plot
🚷 view threshold
5,685.00
(-1.88%)
5,996.91
(94.80%)
📈 view plot
🚷 view threshold
19.00
(+41.64%)
22.98
(82.67%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
164.00
(+3.55%)
163.84
(100.10%)
🐰 View full continuous benchmarking report in Bencher

fi3 added 18 commits December 19, 2024 09:44
Coinbase signature is not part of the Sv2 protocol, some pool maybe want
to use it other not. The first part of the extranonce could also be
reserved for things that are not a pool signature. This pr rename the
pool_signature field of the channel factory into additional_coinbase_script_data
and change the type from Strgin to Vec<u8>, since can be anything.
The coinbase input script additional data should be sent as part of the
extranonce_prefix and not as part of the coinbase_prefix. So that a JDC
can see what the pool want as coinbase input script additional data
without the need to observ the coinbase prefix in job constructed by the
pool.
Update the pool to use an extranonce of 16 bytes rather then 32 so that
there is enaugh space to add the additional coinbase input script data.
Right now the channel factory only support one active job at time. That
means that if we receive a share for a job right after we sent downstream
a new job that share will be invalid. Now the channel factory keep track
of the last 3 jobs, so we give time to the dowstream to receive the job
and propagate it down before stop accepting shares for older job. This
is useful, and the system can be more responsive: as soon as we
change the coinbase additional input script data we can send a new job
dowsntream without worrying of invalidating miner's shares. When the
pool receive a prev hash it immidiatly invalidate all the previous jobs,
we still want to refuse shares for stale jobs. The client can easly handle
this situation: when a pool refuse a share it should start a timer and if do
not receive a new prev hash (or already have) within n seconds it change
pool.
This commit fix 2 miner things:

When we calculate the coinbase_prefix (what we need to put in the
extended job) we need to account also for the coinbase input script
additional data that is part of the extranonce.

When we create pool channel facotry we pass an extranonce creator and an
pool signature. If the signature + extranonce are bigger then 32 bytes
we have to return an error. That cause in sv2 the extranonce can not be
longer than 32 bytes.
The translator normalize the coinbase and remove the segwit data
from the coinbase prefix and suffix. In order to do that it need to know
the extranonce len, we used a default value of 322 bytes, but the pool
could use also smalle extranonces.
 Add a method that the pool can use in order to change
 coinbase_script_additional_data of an already opened
 channel and send downstream the new extranonce_prefix
@Fi3 Fi3 changed the title [WIP] Remove short ids Remove short ids Dec 20, 2024
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