General release information
Highlights of this release:
This release closes the buffer_sv2, codec_sv2 and framing_sv2 audit trackers with a hardening pass over the buffer pool and the codec, renames Mining and Template Distribution message fields to follow the spec cleanup, and lets channels_sv2 server channels serve application-supplied jobs. Every published crate that changed takes an incompatible version bump, except noise_sv2, which only gains a re-export.
Notable highlights include:
mining_sv2andtemplate_distribution_sv2message fields were renamed to match the spec:SetTarget.maximum_targetis nowtarget,UpdateChannel.maximum_targetismax_target,min_ntimeisntime_startonNewMiningJob,NewExtendedMiningJob,SetNewPrevHashandSetCustomMiningJob, and the TDPSetNewPrevHash/SubmitSolutionheader fields arentime_start,ntimeandnonce. Theinvalid-min-ntimeerror code becameinvalid-ntime-start. Nothing changes on the wire.buffer_sv2received an extensive hardening pass over the pool: slot bookkeeping and mode switches were fixed, pool memory is kept alive while a slice points into it, slices are copied on clone, capacities are checked without overflowing, and the API now separates reserving space from committing written bytes.get_writable,get_data_by_ref,danger_set_start,droppableand theWritetrait were removed. A randomized model test exercises slice lifetimes against the pool.codec_sv2andframing_sv2close their audit trackers: encoders reject frames whose encoded length a header cannot declare,MessageFrame::encode_intoerrors on a payload shorter than its header declares, and the noise decoder decrypts the header and each payload chunk as soon as it is buffered instead of holding up to 16 MiB of ciphertext.Decoded::IncompleteandDecrypted::Incompleteno longer carry a byte count,SerializedFrame::from_partswas removed, and every encoder and decoder gained awith_capacityconstructor.channels_sv2server channels can now serve prebuilt jobs: aPrebuiltJobcarrying theNewExtendedMiningJobwire fields (including its ownntime_start) goes intoon_prebuilt_jobon group, standard and extended channels, andactivate_future_job(job_id, chain_tip)activates a future job without a Template Distribution message. Standard jobs now keep their coinbase bytes and exposeget_origininstead ofget_template.channels_sv2fixed several share and job defects: standard jobs installed from a group channel no longer duplicate the template's coinbase outputs, a reusedjob_idinadd_future_jobnow releases the replaced job's extranonce prefixes and keeps the future-job cap honest,BlockFoundwork credit is capped at the difficulty the hash proved, a block-finding share now counts towardbest_diff,set_targetrefuses a target above the channel'smax_target, andget_job_target(job_id)exposes the per-job target a share is validated against.channels_sv2coinbase handling: the witness reserved value, marker and flag are only added when the template carries a witness commitment, so blocks found on templates without one are no longer rejected asunexpected-witness, andtry_strip_bip141refuses coinbases with more than one input.binary_sv2validatesF32values during serialization (NaN, infinities and negative values returnError::InvalidF32) and bounds theDebugoutput ofSeq0255andSeq064K.parsers_sv2rejects TLV values longer than the length field can declare:Tlv::newreturns aResult, andTlvErrorgainsValueTooLongandLengthMismatch.sv1_apiserializesversion-rolling.min-bit-countinmining.configureas a JSON integer, as BIP 310 requires.noise_sv2re-exports the aeadBuffertrait asAeadBuffer.- Fuzzing: structured generators cover the SV2 data types and every common, job declaration, mining and template distribution message.
Crate changes
stratum-core
crate version was bumped from 0.6.0 to 0.7.0
channels_sv2
crate version was bumped from 8.0.0 to 9.0.0
binary_sv2
crate version was bumped from 7.0.0 to 8.0.0
buffer_sv2
crate version was bumped from 3.0.1 to 4.0.0
codec_sv2
crate version was bumped from 7.0.0 to 8.0.0
framing_sv2
crate version was bumped from 8.0.0 to 9.0.0
noise_sv2
crate version was bumped from 2.0.0 to 2.1.0
sv1_api
crate version was bumped from 6.0.0 to 7.0.0
stratum_translation
crate version was bumped from 0.5.0 to 0.6.0
parsers_sv2
crate version was bumped from 0.6.0 to 0.7.0
handlers_sv2
crate version was bumped from 0.6.0 to 0.7.0
extensions_sv2
crate version was bumped from 0.3.0 to 0.4.0
common_messages_sv2
crate version was bumped from 9.0.0 to 10.0.0
mining_sv2
crate version was bumped from 12.0.0 to 13.0.0
job_declaration_sv2
crate version was bumped from 10.0.0 to 11.0.0
template_distribution_sv2
crate version was bumped from 7.0.0 to 8.0.0
What's Changed
- Patch stratum-core in the sv2-apps workspace root by @bit-aloo in #2401
- rename message fields, aligning with spec cleanup by @plebhash in #2368
- fix(sv1_api): serialize configure min-bit-count as integer by @cfilipescu in #2369
channels_sv2: fix group -> standard job creation by @plebhash in #2411- docs(agents): define a schema for issues triaged from audit findings by @plebhash in #2417
- fix(channels_sv2): handle a reused job_id in add_future_job by @Jolah1 in #2420
- docs(agents): keep the fix out of audit issues by @plebhash in #2423
buffer_sv2hardening by @bit-aloo in #2408- fix(parsers-sv2)!: reject TLV values the length field cannot declare by @Christopherdominic in #2431
- codec-sv2, framing-sv2: bound encoded frames and decrypt noise chunks as they arrive by @bit-aloo in #2427
- fix(binary-sv2): bound sequence Debug output by @Chibey-max in #2428
- add generators to fuzz target by @lucasbalieiro in #2350
- feat(channels_sv2)!: serve prebuilt jobs on server channels by @plebhash in #2445
- fix(channels-sv2): cap BlockFound work credit at proven difficulty by @plebhash in #2406
- fix(mining_sv2, job_declaration_sv2): correct two Display format strings by @amartya1523 in #2449
- docs: point example links at sv2/ and fix the channel_msg bit wording by @amartya1523 in #2450
- feat(channels-sv2): add get_job_target to server channels by @plebhash in #2455
- fix(channels-sv2): refuse set_target above the channel's max_target by @plebhash in #2456
- docs(channels-sv2): clarify version rolling policy by @Christopherdominic in #2429
- fix(channels_sv2): count a block-finding share toward best_diff by @amartya1523 in #2447
- fix(channels_sv2)!: let a prebuilt job carry its own ntime_start by @plebhash in #2452
- fix(channels_sv2)!: coinbase witness handling gaps by @Jolah1 in #2457
- feat(binary-sv2)!: validate F32 values during serialization by @lucasbalieiro in #2436
New Contributors
- @cfilipescu made their first contribution in #2369
- @Jolah1 made their first contribution in #2420
- @Christopherdominic made their first contribution in #2431
- @Chibey-max made their first contribution in #2428
- @amartya1523 made their first contribution in #2449
Full Changelog: v1.12.0...v1.13.0