From 81eec5cbbb587467eb257b2a8bb00ddb76ba5a4a Mon Sep 17 00:00:00 2001 From: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com> Date: Mon, 22 Jan 2024 18:17:34 +0000 Subject: [PATCH] consensus: add more difficulty tests --- consensus/Cargo.toml | 2 +- consensus/rules/Cargo.toml | 2 +- consensus/src/bin/scan_chain.rs | 18 ++------ consensus/src/tests/context/data.rs | 2 + .../tests/context/data/dif_3000000_3002000 | 1 + consensus/src/tests/context/difficulty.rs | 42 ++++++++++++++++++- helper/src/num.rs | 18 +++++++- 7 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 consensus/src/tests/context/data/dif_3000000_3002000 diff --git a/consensus/Cargo.toml b/consensus/Cargo.toml index 30a13401..8619a33e 100644 --- a/consensus/Cargo.toml +++ b/consensus/Cargo.toml @@ -44,7 +44,7 @@ dalek-ff-group = { workspace = true } rayon = { workspace = true } thread_local = { workspace = true } -tokio = { workspace = true } +tokio = { workspace = true, features = ["rt"] } tokio-util = { workspace = true } hex = "0.4" diff --git a/consensus/rules/Cargo.toml b/consensus/rules/Cargo.toml index d553d516..d7dc42bb 100644 --- a/consensus/rules/Cargo.toml +++ b/consensus/rules/Cargo.toml @@ -17,7 +17,7 @@ multiexp = { workspace = true, features = ["std", "batch"] } dalek-ff-group = { workspace = true, features = ["std"] } curve25519-dalek = { workspace = true, features = ["alloc", "zeroize", "precomputed-tables"] } -rand = { workspace = true, features = ["std"] } +rand = { workspace = true, features = ["std", "std_rng"] } hex = { workspace = true, features = ["std"] } hex-literal = { workspace = true } diff --git a/consensus/src/bin/scan_chain.rs b/consensus/src/bin/scan_chain.rs index d8665420..7e747060 100644 --- a/consensus/src/bin/scan_chain.rs +++ b/consensus/src/bin/scan_chain.rs @@ -19,7 +19,7 @@ mod bin { use tower::{Service, ServiceExt}; use tracing::level_filters::LevelFilter; - use cuprate_helper::network::Network; + use cuprate_helper::{asynch::rayon_spawn_async, network::Network}; use cuprate_consensus::{ block::PrePreparedBlockExPOW, @@ -336,18 +336,6 @@ mod bin { Ok(()) } - async fn rayon_spawn_async(f: F) -> R - where - F: FnOnce() -> R + Send + 'static, - R: Send + 'static, - { - let (tx, rx) = tokio::sync::oneshot::channel(); - rayon::spawn(|| { - let _ = tx.send(f()); - }); - rx.await.expect("The sender must not be dropped") - } - #[derive(Parser)] struct Args { /// The log level, valid values: @@ -515,4 +503,6 @@ async fn main() { } #[cfg(not(feature = "binaries"))] -fn main() {} +fn main() { + panic!("must run with feature `binaries`") +} diff --git a/consensus/src/tests/context/data.rs b/consensus/src/tests/context/data.rs index 086e4bef..fab1aa57 100644 --- a/consensus/src/tests/context/data.rs +++ b/consensus/src/tests/context/data.rs @@ -7,3 +7,5 @@ pub static HFS_2678808_2688888: [(HardFork, HardFork); 10080] = include!("./data/hfs_2678808_2688888"); pub static BW_2850000_3050000: [(usize, usize); 200_000] = include!("./data/bw_2850000_3050000"); + +pub static DIF_3000000_3002000: [(u128, u64); 2000] = include!("./data/dif_3000000_3002000"); diff --git a/consensus/src/tests/context/data/dif_3000000_3002000 b/consensus/src/tests/context/data/dif_3000000_3002000 new file mode 100644 index 00000000..333f8d11 --- /dev/null +++ b/consensus/src/tests/context/data/dif_3000000_3002000 @@ -0,0 +1 @@ +[(312831186335450213, 1697813342), (312831494888547335, 1697813354), (312831803742793618, 1697813363), (312832112065319588, 1697813516), (312832420676448856, 1697813830), (312832729034093789, 1697813836), (312833036840487410, 1697813847), (312833345347139345, 1697814034), (312833654317341014, 1697814121), (312833963527097271, 1697814261), (312834273342849398, 1697814336), (312834583406228345, 1697814768), (312834891542701578, 1697814812), (312835198958238832, 1697814900), (312835506677532559, 1697814974), (312835814603619718, 1697815228), (312836121761637172, 1697815255), (312836428101602582, 1697815488), (312836734435001352, 1697815493), (312837039507798982, 1697815521), (312837344509971833, 1697815580), (312837649325933327, 1697815765), (312837953299700332, 1697815772), (312838257127114763, 1697815837), (312838560076937907, 1697815850), (312838864599158629, 1697815988), (312839167973112558, 1697816105), (312839470878953495, 1697816245), (312839774835806329, 1697816434), (312840078312486644, 1697816473), (312840381648873018, 1697816540), (312840685936686691, 1697816681), (312840990179961563, 1697816688), (312841294451157759, 1697816784), (312841598894739661, 1697816797), (312841901782007428, 1697816803), (312842204877254680, 1697817265), (312842508320050980, 1697817367), (312842811135308931, 1697817562), (312843113742539152, 1697817723), (312843416565400129, 1697817881), (312843718429194929, 1697817892), (312844020270904925, 1697818067), (312844321495167485, 1697818073), (312844622608910733, 1697818150), (312844923645107637, 1697818260), (312845224595743754, 1697818305), (312845525518264986, 1697818346), (312845825734405972, 1697818351), (312846125980474578, 1697818507), (312846425767037469, 1697818532), (312846725019890449, 1697819020), (312847024491556542, 1697819024), (312847322063749008, 1697819071), (312847620808217788, 1697819187), (312847919769082173, 1697819223), (312848219370457246, 1697819224), (312848518697580929, 1697819261), (312848818095080916, 1697819447), (312849117430329730, 1697819450), (312849417068006372, 1697819532), (312849716279625025, 1697819599), (312850014443355273, 1697819680), (312850312613264578, 1697819683), (312850610780880867, 1697819890), (312850908834135638, 1697819901), (312851207284948580, 1697819989), (312851505595779805, 1697820044), (312851803899020684, 1697820051), (312852099347732929, 1697820360), (312852393760506359, 1697820546), (312852688068018546, 1697821173), (312852982386369169, 1697821373), (312853276289002079, 1697821406), (312853570992323209, 1697821419), (312853865646895770, 1697821456), (312854160131562933, 1697821613), (312854455110338143, 1697821722), (312854750207626714, 1697821817), (312855044916836598, 1697821839), (312855338969139205, 1697821900), (312855633065192920, 1697821904), (312855927852159795, 1697822204), (312856222435652424, 1697822273), (312856516747712641, 1697822425), (312856810724192483, 1697822435), (312857104572409570, 1697823065), (312857396867809905, 1697823126), (312857690556008955, 1697823139), (312857984539670199, 1697823219), (312858278361186603, 1697823225), (312858571592850595, 1697823337), (312858864942857634, 1697823387), (312859157712640719, 1697823830), (312859450492438522, 1697824115), (312859743921099715, 1697824133), (312860037649519952, 1697824139), (312860330786819653, 1697824178), (312860624024828724, 1697824324), (312860917903334026, 1697824366), (312861213971022602, 1697824586), (312861509562482254, 1697824678), (312861805246808026, 1697824828), (312862100549768411, 1697824886), (312862395747978561, 1697824954), (312862691124868039, 1697825120), (312862986391657402, 1697825574), (312863281313853456, 1697825836), (312863576260990217, 1697825879), (312863871844968116, 1697826194), (312864167766574780, 1697826369), (312864463692543039, 1697826383), (312864758892284412, 1697826594), (312865054902494201, 1697826721), (312865350728740089, 1697826775), (312865646371495033, 1697826979), (312865942056640247, 1697827116), (312866238681501427, 1697827425), (312866534715176380, 1697827505), (312866831090530013, 1697827659), (312867127170654478, 1697827724), (312867422862108684, 1697827775), (312867718388419714, 1697827936), (312868014335786053, 1697828207), (312868311326120706, 1697828217), (312868609140809780, 1697828238), (312868907166723946, 1697828612), (312869203830568238, 1697828737), (312869501618440922, 1697828819), (312869799595003564, 1697828850), (312870097263603375, 1697829039), (312870395009408799, 1697829106), (312870693020448772, 1697829138), (312870990950580051, 1697829231), (312871291695046343, 1697829296), (312871592711493096, 1697829303), (312871894323304546, 1697829346), (312872196346490262, 1697829353), (312872498431805228, 1697829359), (312872800664603172, 1697829534), (312873102342647729, 1697829640), (312873404728287048, 1697829853), (312873707418658865, 1697829995), (312874010718880682, 1697830188), (312874314717699390, 1697830222), (312874617504201650, 1697830370), (312874919894441514, 1697830398), (312875220112105635, 1697830582), (312875519526876226, 1697830716), (312875820320188720, 1697830741), (312876122419191696, 1697830782), (312876424344736827, 1697830822), (312876726450442172, 1697830879), (312877028242409602, 1697830928), (312877329689124100, 1697830968), (312877632274141185, 1697830974), (312877934724275064, 1697831146), (312878237589516308, 1697831153), (312878539546087198, 1697831358), (312878841374025844, 1697831532), (312879142709636774, 1697831551), (312879444777252060, 1697831610), (312879744412764000, 1697831712), (312880044514594127, 1697831761), (312880344710835549, 1697831950), (312880644740106689, 1697831960), (312880945131587928, 1697832288), (312881245067248999, 1697832383), (312881544867358488, 1697832384), (312881843470689527, 1697832419), (312882140941872421, 1697832419), (312882439928737316, 1697832449), (312882739913528323, 1697832677), (312883039783090714, 1697832687), (312883340367535035, 1697832754), (312883640850680199, 1697832814), (312883940542642288, 1697832821), (312884240024563314, 1697832952), (312884539382212749, 1697833197), (312884840771976866, 1697833462), (312885141901070806, 1697833500), (312885443233694628, 1697833547), (312885742743921742, 1697833720), (312886041259201041, 1697833743), (312886340289396401, 1697833793), (312886638249207824, 1697833824), (312886936493304917, 1697833829), (312887234933937456, 1697833861), (312887533074325314, 1697834070), (312887831145992295, 1697834115), (312888129633782211, 1697834162), (312888427318163465, 1697834215), (312888724689150119, 1697834221), (312889021434191386, 1697834270), (312889318968868680, 1697834308), (312889616041492883, 1697834385), (312889912863017568, 1697834405), (312890209722596700, 1697834578), (312890505950830623, 1697834600), (312890802161753020, 1697834903), (312891098338231111, 1697834957), (312891395212025568, 1697835090), (312891690821811550, 1697835118), (312891986194843218, 1697835509), (312892281238604886, 1697835563), (312892576562008528, 1697835784), (312892871195693894, 1697835794), (312893165805087032, 1697836056), (312893460281730841, 1697836197), (312893755269744984, 1697836200), (312894050749722882, 1697836216), (312894346451753831, 1697836226), (312894643215373761, 1697836425), (312894940133145662, 1697836444), (312895237233876589, 1697836562), (312895533638493541, 1697836705), (312895829909552296, 1697836963), (312896125341687416, 1697836992), (312896420465981944, 1697837222), (312896715406169033, 1697837291), (312897010317484287, 1697837294), (312897304760012825, 1697837336), (312897599746716576, 1697837621), (312897894507075486, 1697837697), (312898189348261587, 1697837801), (312898484470105852, 1697837808), (312898780148273517, 1697837941), (312899075891037845, 1697837984), (312899371561804245, 1697837997), (312899668385617810, 1697838059), (312899965624730413, 1697838125), (312900262977051620, 1697838346), (312900559718501986, 1697838561), (312900857118332098, 1697838594), (312901153720092461, 1697839124), (312901449677175542, 1697839163), (312901745585834323, 1697839287), (312902042371658731, 1697839293), (312902339049286471, 1697839371), (312902635587920697, 1697839401), (312902931466157977, 1697839615), (312903227314657050, 1697839624), (312903523686872595, 1697839626), (312903821738728646, 1697839693), (312904119785007036, 1697839746), (312904417732346529, 1697839948), (312904715731125252, 1697839957), (312905013621185368, 1697840114), (312905310857906172, 1697840227), (312905608877958912, 1697840464), (312905906852187896, 1697840485), (312906205121089380, 1697840644), (312906505595084276, 1697841034), (312906805581008033, 1697841036), (312907105290531423, 1697841049), (312907404262978505, 1697841052), (312907703624086994, 1697841216), (312908002925583423, 1697841294), (312908301664916709, 1697841398), (312908600670024977, 1697841444), (312908899474882560, 1697841447), (312909198343804103, 1697841528), (312909498286420390, 1697841545), (312909798627424449, 1697841638), (312910099678014277, 1697841928), (312910401497839900, 1697841936), (312910704025375925, 1697842114), (312911006624088205, 1697842473), (312911310703341949, 1697842599), (312911615207797079, 1697842641), (312911919601456433, 1697842650), (312912224035914860, 1697842721), (312912528623201089, 1697842903), (312912833006647856, 1697843179), (312913138354811143, 1697843443), (312913442828138146, 1697843458), (312913748066333040, 1697843598), (312914053413839983, 1697843602), (312914358989417344, 1697843629), (312914662920913997, 1697843789), (312914966737956430, 1697843794), (312915269663161966, 1697843944), (312915572869077045, 1697844047), (312915876319358430, 1697844088), (312916179785064938, 1697844317), (312916483239077186, 1697844459), (312916787061562070, 1697844478), (312917090882502916, 1697844487), (312917394404503755, 1697844494), (312917697848953378, 1697844636), (312918000962260362, 1697844646), (312918305587172965, 1697844766), (312918609563528363, 1697844928), (312918913420824573, 1697844999), (312919217610073818, 1697845342), (312919521806194375, 1697845512), (312919826335662775, 1697845638), (312920131972037876, 1697845664), (312920436419601204, 1697845705), (312920741747468825, 1697845739), (312921047543009177, 1697845867), (312921353571571181, 1697846104), (312921659817836628, 1697846365), (312921965865312719, 1697846453), (312922274671712191, 1697846583), (312922583297508102, 1697846591), (312922891809248311, 1697846610), (312923200309701496, 1697847067), (312923509163802416, 1697847135), (312923818165335037, 1697847142), (312924124980553277, 1697847234), (312924431741994797, 1697847408), (312924739457809289, 1697847416), (312925047926171215, 1697847617), (312925356084216989, 1697847660), (312925665179075113, 1697847744), (312925975621252076, 1697847963), (312926286434391044, 1697848041), (312926597500369551, 1697848109), (312926908496447521, 1697848112), (312927219377190569, 1697848123), (312927530534864926, 1697848150), (312927841882144840, 1697848290), (312928152528084365, 1697848556), (312928462780133357, 1697848697), (312928773143263213, 1697848743), (312929083473084289, 1697848836), (312929393273999484, 1697848933), (312929701537059986, 1697849241), (312930009889627526, 1697849325), (312930318203261291, 1697849413), (312930626873253790, 1697849528), (312930935438825225, 1697849590), (312931243688662108, 1697849699), (312931551480725178, 1697849746), (312931859210809459, 1697849902), (312932167286841232, 1697849907), (312932475354949399, 1697849959), (312932783694736129, 1697850431), (312933091643272093, 1697850484), (312933399756078435, 1697850506), (312933708209038254, 1697850533), (312934016560210270, 1697850537), (312934323358083733, 1697850647), (312934629748093288, 1697850741), (312934936384839878, 1697850837), (312935243255878866, 1697850859), (312935549851392900, 1697850900), (312935856495769891, 1697851221), (312936162737326674, 1697851230), (312936467850412437, 1697851584), (312936773467123010, 1697851585), (312937079038730142, 1697851614), (312937385148546135, 1697851998), (312937692015154558, 1697852045), (312938000371673370, 1697852054), (312938308824971326, 1697852176), (312938617196003887, 1697852376), (312938925152812476, 1697852385), (312939232956879019, 1697852498), (312939540012258387, 1697852715), (312939847236238092, 1697852833), (312940154583034934, 1697852852), (312940462663812651, 1697852878), (312940771287626494, 1697853119), (312941079973768932, 1697853139), (312941389926451374, 1697853534), (312941699369234519, 1697853656), (312942008267804582, 1697853738), (312942317337328508, 1697853812), (312942626012180543, 1697853915), (312942934085383645, 1697854004), (312943241650586094, 1697854057), (312943549398456405, 1697854197), (312943857154906968, 1697854212), (312944165445207672, 1697854341), (312944473926989437, 1697854552), (312944781400824467, 1697854672), (312945088348200356, 1697854714), (312945395832673410, 1697854943), (312945703602307126, 1697854958), (312946011381541200, 1697854969), (312946319778952487, 1697855005), (312946626769900298, 1697855138), (312946934028971454, 1697855206), (312947241584746976, 1697855265), (312947548849098898, 1697855823), (312947855835922592, 1697855955), (312948163059219260, 1697856013), (312948469463453148, 1697856070), (312948775774188352, 1697856270), (312949081780811786, 1697856350), (312949386983434932, 1697856521), (312949692358214007, 1697856528), (312949999789388169, 1697856753), (312950307240291106, 1697856836), (312950614862933295, 1697856899), (312950922404241098, 1697856950), (312951229542892279, 1697856991), (312951535757386821, 1697857028), (312951841757932555, 1697857037), (312952147582495359, 1697857038), (312952453507349903, 1697857296), (312952759183221158, 1697857445), (312953064106350056, 1697857451), (312953368890713751, 1697857455), (312953673836397872, 1697857666), (312953978906579450, 1697857757), (312954283722010240, 1697857816), (312954588475062614, 1697857821), (312954893118625654, 1697858059), (312955199348237377, 1697858077), (312955506028720308, 1697858135), (312955812818950708, 1697858160), (312956117893037505, 1697858282), (312956423219287535, 1697858331), (312956728718879963, 1697858447), (312957034834852201, 1697858470), (312957341803551379, 1697858492), (312957648865818878, 1697858501), (312957955591966928, 1697858504), (312958262205813939, 1697858528), (312958569016381890, 1697858552), (312958877992178287, 1697858561), (312959186286576027, 1697858674), (312959494585227196, 1697858702), (312959801412349539, 1697858827), (312960108739870243, 1697858840), (312960416346266711, 1697859000), (312960723265394161, 1697859014), (312961029984546412, 1697859018), (312961337437069840, 1697859044), (312961644458397250, 1697859059), (312961950840887814, 1697859065), (312962258323420012, 1697859378), (312962565573861094, 1697859442), (312962872068628845, 1697859464), (312963178671128187, 1697859577), (312963485313048509, 1697859599), (312963793451226855, 1697859948), (312964100632172188, 1697860007), (312964408952126714, 1697860020), (312964715855791000, 1697860149), (312965022262665186, 1697860305), (312965328953441432, 1697860373), (312965635385482453, 1697860754), (312965942597449283, 1697860759), (312966251698485168, 1697860907), (312966560922401571, 1697861055), (312966869547200020, 1697861109), (312967178342387824, 1697861231), (312967486894262649, 1697861245), (312967794810775538, 1697861408), (312968103059916383, 1697861412), (312968411702300207, 1697861539), (312968719832655647, 1697861767), (312969029681004064, 1697861802), (312969341172353655, 1697861827), (312969652548239729, 1697862018), (312969963524194655, 1697862045), (312970274190225166, 1697862272), (312970585420253982, 1697862325), (312970894307121073, 1697862337), (312971202779592445, 1697862786), (312971513093106261, 1697862796), (312971823728840332, 1697863300), (312972134537600467, 1697863374), (312972446189635121, 1697863396), (312972757692922780, 1697863578), (312973069557262571, 1697863938), (312973380753435159, 1697864103), (312973691936087848, 1697864170), (312974004316433816, 1697864256), (312974316465024311, 1697864407), (312974630699176610, 1697864415), (312974944826931110, 1697864417), (312975259573711161, 1697864569), (312975574759250020, 1697864570), (312975889830494358, 1697865148), (312976204986855999, 1697865182), (312976520999414431, 1697865183), (312976837249069029, 1697865592), (312977153380646123, 1697865744), (312977469546075420, 1697865789), (312977786729603499, 1697865811), (312978104596531476, 1697865865), (312978421392920720, 1697865937), (312978739301342934, 1697866134), (312979057056705620, 1697866332), (312979374793672946, 1697866354), (312979693170870686, 1697866382), (312980011346836788, 1697866454), (312980329164224320, 1697866547), (312980647004183708, 1697866719), (312980964731290337, 1697866806), (312981283044168971, 1697866811), (312981601380418569, 1697866826), (312981922482257324, 1697867272), (312982243984771217, 1697867304), (312982566726683284, 1697867469), (312982889041352528, 1697867568), (312983211242747129, 1697867609), (312983534834228293, 1697867808), (312983858687124428, 1697867869), (312984182581236601, 1697867879), (312984506593646192, 1697868058), (312984831325920261, 1697868111), (312985156595088120, 1697868164), (312985482213093165, 1697868205), (312985808020288272, 1697868234), (312986132896901033, 1697868407), (312986459294729368, 1697868533), (312986785732611252, 1697868564), (312987112006059406, 1697868591), (312987438289566886, 1697869119), (312987763864469596, 1697869121), (312988090476608025, 1697869157), (312988417216000737, 1697869310), (312988743590504905, 1697869567), (312989069653303605, 1697869651), (312989395495300476, 1697869705), (312989720196858220, 1697869714), (312990045126083406, 1697870046), (312990369860674454, 1697870126), (312990694068680314, 1697870180), (312991018071188108, 1697870208), (312991341509548185, 1697870213), (312991665408158459, 1697870635), (312991989694567297, 1697870847), (312992315411290113, 1697870952), (312992641541121338, 1697870954), (312992966761929658, 1697871305), (312993293062341639, 1697871337), (312993619505551123, 1697871367), (312993945156348492, 1697871476), (312994270739963499, 1697871538), (312994595795244649, 1697871719), (312994921279356625, 1697871755), (312995246824909021, 1697871766), (312995571692673250, 1697872912), (312995896852866724, 1697873619), (312996220017567928, 1697873712), (312996543338719607, 1697873856), (312996867244135629, 1697873975), (312997191178169586, 1697874053), (312997514383024309, 1697874266), (312997837259080324, 1697874273), (312998160722803868, 1697874331), (312998484353438774, 1697874345), (312998807279074234, 1697874567), (312999130325557949, 1697874698), (312999453689030175, 1697874803), (312999776458295116, 1697874937), (313000099245263049, 1697875138), (313000419434014257, 1697875149), (313000739732779716, 1697875339), (313001060407403909, 1697875607), (313001379484517154, 1697875667), (313001697882768191, 1697875961), (313002016332676097, 1697875986), (313002335643674994, 1697876078), (313002655096789842, 1697876147), (313002974483592005, 1697876156), (313003293374418413, 1697876206), (313003611659006919, 1697876258), (313003933140882204, 1697876426), (313004254615348007, 1697876527), (313004575861899665, 1697876948), (313004896945155473, 1697876951), (313005217426827882, 1697877029), (313005537857858385, 1697877054), (313005858633899404, 1697877134), (313006181153499737, 1697877166), (313006503127469250, 1697877197), (313006825040856692, 1697877208), (313007150853860783, 1697877279), (313007476483127947, 1697877355), (313007802365246104, 1697877419), (313008127521295539, 1697877471), (313008453230676782, 1697877558), (313008779758257201, 1697877567), (313009106087237862, 1697878180), (313009432448887394, 1697878250), (313009759049409074, 1697878362), (313010085699809544, 1697878378), (313010412342099900, 1697878725), (313010739786980065, 1697878727), (313011066704020947, 1697878911), (313011393935057306, 1697879415), (313011721474675636, 1697879422), (313012048026090515, 1697879428), (313012375278863225, 1697880036), (313012702978968691, 1697880117), (313013030533882604, 1697880137), (313013357408866887, 1697880249), (313013684386367622, 1697880343), (313014011582663442, 1697880466), (313014338800187559, 1697880577), (313014664903770517, 1697880645), (313014991145761517, 1697880798), (313015317389492754, 1697880801), (313015643831949919, 1697880815), (313015971110909240, 1697880857), (313016296609072347, 1697880906), (313016621394292777, 1697881081), (313016946425644229, 1697881258), (313017271695226217, 1697881372), (313017595330434140, 1697881463), (313017919192674662, 1697881743), (313018243839518700, 1697881786), (313018568021838907, 1697881972), (313018894118854711, 1697882007), (313019220526660792, 1697882275), (313019547695239143, 1697882324), (313019874859367645, 1697882326), (313020197781995876, 1697882367), (313020518678910216, 1697882386), (313020839456166172, 1697882483), (313021161050012235, 1697882641), (313021482298215021, 1697882654), (313021803431987710, 1697882684), (313022124921165014, 1697882688), (313022446747648009, 1697882888), (313022769429397588, 1697883370), (313023092090862257, 1697883385), (313023415813053482, 1697883491), (313023739497185275, 1697883533), (313024063253867405, 1697883647), (313024388596831649, 1697883777), (313024713173388777, 1697883831), (313025038631821544, 1697884019), (313025363284665031, 1697884266), (313025687484668098, 1697884335), (313026011545490645, 1697884358), (313026337351050819, 1697884501), (313026663080191997, 1697884503), (313026988424670164, 1697884555), (313027314678937594, 1697884706), (313027641614557535, 1697884729), (313027968830587808, 1697884801), (313028297114360223, 1697884938), (313028624940318671, 1697884941), (313028953051129213, 1697885032), (313029279268404893, 1697885043), (313029605752263799, 1697885204), (313029931992749190, 1697885397), (313030258260996812, 1697885569), (313030585032865786, 1697885699), (313030911853550767, 1697885709), (313031239332502030, 1697885918), (313031567569653938, 1697885962), (313031896100176556, 1697886101), (313032226802586616, 1697886314), (313032557379337161, 1697886365), (313032887759905157, 1697886608), (313033217857666356, 1697886859), (313033548292368610, 1697886893), (313033875977306747, 1697887007), (313034203467279834, 1697887264), (313034530778171605, 1697887278), (313034858693247437, 1697887294), (313035186364033855, 1697887402), (313035514178259189, 1697887480), (313035841270251775, 1697887496), (313036166593125514, 1697887574), (313036492048255964, 1697887697), (313036818050515620, 1697887735), (313037141359173705, 1697887878), (313037468008390138, 1697887931), (313037796082677367, 1697887955), (313038123780784680, 1697888067), (313038451379237208, 1697888138), (313038779121812177, 1697888154), (313039106380053503, 1697888196), (313039433529858633, 1697888223), (313039760507106578, 1697888230), (313040087559460478, 1697888418), (313040414618861219, 1697888451), (313040742251142753, 1697888930), (313041071208026211, 1697889019), (313041399367491211, 1697889144), (313041726749524097, 1697889328), (313042054516338830, 1697889405), (313042382289817064, 1697889677), (313042709409343298, 1697889681), (313043036710449308, 1697889690), (313043365234850732, 1697890286), (313043693835329018, 1697890348), (313044021591740308, 1697890669), (313044349504466734, 1697890762), (313044678683141058, 1697891025), (313045007821334572, 1697891109), (313045338038520092, 1697891134), (313045667828078829, 1697891138), (313045997008428436, 1697891347), (313046326443598386, 1697891434), (313046656671078273, 1697891627), (313046986944773291, 1697891697), (313047316585710250, 1697891713), (313047643972000167, 1697891803), (313047971988069198, 1697891958), (313048300093918973, 1697892125), (313048628714686240, 1697892530), (313048957737496818, 1697892579), (313049286354430751, 1697892648), (313049615072728026, 1697892747), (313049943599316523, 1697892748), (313050270995400521, 1697892960), (313050598557746323, 1697893034), (313050926106451791, 1697893052), (313051253032923551, 1697893073), (313051582236414918, 1697893695), (313051911724010238, 1697893709), (313052241469411696, 1697893716), (313052571937498766, 1697893824), (313052902874017334, 1697893828), (313053233235891568, 1697894044), (313053564494083536, 1697894084), (313053895379949744, 1697894089), (313054226637318069, 1697894273), (313054557687940362, 1697894471), (313054888053522558, 1697894498), (313055217820553602, 1697894736), (313055547022843428, 1697894742), (313055876987796393, 1697894821), (313056206101081879, 1697894969), (313056537449203711, 1697895312), (313056868182436182, 1697895344), (313057198158324535, 1697895366), (313057528510352496, 1697895436), (313057857903524549, 1697895440), (313058186133264552, 1697895465), (313058514432758498, 1697895469), (313058843132371688, 1697895494), (313059170650648652, 1697895617), (313059498546690040, 1697895647), (313059826740642839, 1697895816), (313060154856033428, 1697895889), (313060482660918591, 1697895970), (313060811443256321, 1697896052), (313061139948436804, 1697896095), (313061468331664737, 1697896130), (313061796846453532, 1697896148), (313062124746776683, 1697896181), (313062453944794751, 1697896331), (313062783993878116, 1697896340), (313063116643824777, 1697896546), (313063449996317014, 1697896930), (313063783494548231, 1697896934), (313064116906449450, 1697897062), (313064450426690820, 1697897160), (313064784756442464, 1697897276), (313065118747894646, 1697897285), (313065453107671159, 1697897588), (313065785248794660, 1697897674), (313066117313763841, 1697897725), (313066448841965445, 1697897736), (313066781001367205, 1697898170), (313067113180502080, 1697898330), (313067444826624910, 1697898338), (313067776561482271, 1697898403), (313068111448635214, 1697898603), (313068443732793119, 1697898606), (313068775837027945, 1697898765), (313069106814733630, 1697899006), (313069437426652928, 1697899246), (313069767364763596, 1697899324), (313070097200642886, 1697899329), (313070429151776631, 1697899422), (313070762560908972, 1697899508), (313071095086431623, 1697899550), (313071427275380125, 1697899551), (313071758771860593, 1697899652), (313072090708250443, 1697899687), (313072422836509834, 1697900614), (313072755663028681, 1697900882), (313073088235725923, 1697900978), (313073420782223588, 1697901568), (313073751681930734, 1697901757), (313074082734629325, 1697902319), (313074414321934555, 1697902381), (313074747721391606, 1697903064), (313075082481587918, 1697903198), (313075416456456052, 1697903200), (313075751692924236, 1697903223), (313076087775595761, 1697903348), (313076423878772335, 1697903352), (313076757984095589, 1697903425), (313077092712981090, 1697903531), (313077427737687632, 1697903557), (313077763306061040, 1697903827), (313078099606847784, 1697903876), (313078436437879875, 1697904011), (313078773534764311, 1697904128), (313079111450084654, 1697904228), (313079448824590652, 1697904234), (313079785519131552, 1697904351), (313080122954301955, 1697904448), (313080460617849763, 1697904546), (313080798359805520, 1697904656), (313081135865499743, 1697905241), (313081474576896023, 1697905293), (313081812241698671, 1697905672), (313082150219717152, 1697905689), (313082488301195271, 1697905861), (313082827047668906, 1697906056), (313083166173114287, 1697906075), (313083505389022408, 1697906139), (313083845115733079, 1697906142), (313084185098398402, 1697906194), (313084524534304827, 1697906244), (313084864084338858, 1697906408), (313085202853989616, 1697906636), (313085541329427876, 1697906816), (313085880329963096, 1697906856), (313086219501981302, 1697906935), (313086559591749395, 1697906966), (313086900278368594, 1697907047), (313087241914743803, 1697907318), (313087583599782832, 1697907334), (313087925322510977, 1697907513), (313088267194033412, 1697907636), (313088609010536449, 1697907657), (313088949597970118, 1697907682), (313089290352746653, 1697907805), (313089630716936016, 1697907908), (313089970840693659, 1697907967), (313090310720458107, 1697908126), (313090650863331628, 1697908219), (313090989722686562, 1697908274), (313091328228787888, 1697908324), (313091667403463667, 1697908345), (313092006609421553, 1697908989), (313092344706988362, 1697909000), (313092682929940803, 1697909096), (313093021263060102, 1697909113), (313093359619087046, 1697909161), (313093697542638863, 1697909252), (313094035756509518, 1697909673), (313094374179545410, 1697910134), (313094711491972032, 1697910332), (313095049301873878, 1697910451), (313095387251347322, 1697910471), (313095725234467707, 1697910633), (313096062984743523, 1697910653), (313096400366345342, 1697910946), (313096737747590381, 1697911127), (313097076331844684, 1697911136), (313097414512665298, 1697911149), (313097752911375738, 1697911286), (313098087038784287, 1697911299), (313098419943302975, 1697911306), (313098753077477255, 1697911594), (313099084588907559, 1697911667), (313099416521101636, 1697911725), (313099745978083386, 1697911928), (313100075416015060, 1697912017), (313100402489695500, 1697912109), (313100729103282520, 1697912121), (313101056003163615, 1697912562), (313101383005184480, 1697912825), (313101709508066785, 1697912842), (313102036207544131, 1697912921), (313102363609882426, 1697913052), (313102690787882292, 1697913275), (313103018128072056, 1697913318), (313103344513157210, 1697913458), (313103670763822973, 1697913835), (313103996681151985, 1697913847), (313104322297707521, 1697914251), (313104647877207701, 1697914421), (313104973591672877, 1697914467), (313105299636068047, 1697914469), (313105625401163921, 1697914896), (313105952196602539, 1697915227), (313106278801038599, 1697915346), (313106603370587386, 1697915383), (313106927902836908, 1697915472), (313107252562923032, 1697915624), (313107577467776204, 1697915652), (313107902673031886, 1697915720), (313108227097361353, 1697915744), (313108552723893627, 1697915887), (313108878785671601, 1697916179), (313109204924208083, 1697916209), (313109530971277749, 1697916212), (313109856907035785, 1697916384), (313110183079167243, 1697916650), (313110508351655579, 1697916800), (313110833407758665, 1697916883), (313111159013993450, 1697916953), (313111485526757006, 1697916958), (313111812106772547, 1697917002), (313112139461981805, 1697917175), (313112465952921428, 1697917311), (313112792463399381, 1697917322), (313113118417308779, 1697917390), (313113445205763797, 1697917399), (313113772331841775, 1697917769), (313114099906289265, 1697917793), (313114427016107070, 1697918056), (313114754342821657, 1697918215), (313115081670800720, 1697918266), (313115408392970414, 1697918295), (313115735044870723, 1697918324), (313116061819190453, 1697918387), (313116389462595643, 1697918405), (313116718089819583, 1697918753), (313117043935958240, 1697918909), (313117372273562389, 1697919097), (313117700416074963, 1697919143), (313118029134335598, 1697919189), (313118357726390493, 1697919486), (313118686328144937, 1697919516), (313119013172695123, 1697919606), (313119338944836057, 1697919812), (313119663916568786, 1697919834), (313119988421670095, 1697920000), (313120313209902516, 1697920081), (313120637566328029, 1697920417), (313120962825224680, 1697920815), (313121286849456976, 1697920899), (313121610830913451, 1697921141), (313121935357516176, 1697921177), (313122260980720035, 1697921201), (313122586138939588, 1697921318), (313122912029961079, 1697921423), (313123239752550251, 1697921489), (313123566203123912, 1697921530), (313123892430371996, 1697921798), (313124218459703916, 1697921938), (313124544360293344, 1697922048), (313124870261327687, 1697922113), (313125196265753780, 1697922272), (313125522473883595, 1697922517), (313125846720292844, 1697922538), (313126170186348438, 1697922540), (313126493697107623, 1697922811), (313126817315777073, 1697923077), (313127141702367032, 1697923121), (313127465153982630, 1697923164), (313127789260666574, 1697923320), (313128114407481934, 1697923335), (313128438445991364, 1697923456), (313128762657108442, 1697923531), (313129085115224253, 1697923584), (313129407163494200, 1697923639), (313129729859210156, 1697923691), (313130053831654124, 1697923761), (313130377099334450, 1697924518), (313130698980985522, 1697924559), (313131020992583960, 1697924631), (313131342888277942, 1697924925), (313131664537841718, 1697924933), (313131986257853427, 1697924963), (313132307910106181, 1697925306), (313132629967077654, 1697925456), (313132952414424044, 1697925467), (313133274440755111, 1697925505), (313133596222504476, 1697925946), (313133918544486577, 1697926121), (313134240975539717, 1697926129), (313134562712509882, 1697926150), (313134883332291462, 1697926309), (313135203952826969, 1697926318), (313135524285806742, 1697926580), (313135844875541992, 1697926690), (313136166201594852, 1697927114), (313136487686009582, 1697927137), (313136809969949122, 1697927296), (313137132443766408, 1697927582), (313137455471713069, 1697927620), (313137778344498845, 1697927777), (313138101398789853, 1697927848), (313138422982437289, 1697927891), (313138745067407865, 1697928010), (313139067071151254, 1697928104), (313139389567226386, 1697928311), (313139712265020081, 1697928443), (313140035447284570, 1697928467), (313140358565092044, 1697928634), (313140681515357353, 1697928723), (313141006485195971, 1697928846), (313141330217653204, 1697928851), (313141653306154532, 1697928902), (313141975998988969, 1697929109), (313142299303385563, 1697929164), (313142622471724398, 1697929209), (313142945241987326, 1697929436), (313143268104786137, 1697929477), (313143590970267677, 1697929483), (313143913919770525, 1697929595), (313144237144846248, 1697929617), (313144559951742189, 1697929658), (313144882431776852, 1697929688), (313145203484460291, 1697930286), (313145522921257142, 1697930541), (313145842625372024, 1697930544), (313146162457242790, 1697930706), (313146482776079517, 1697930874), (313146803217445479, 1697930986), (313147123577257607, 1697931008), (313147443928350384, 1697931013), (313147765384803973, 1697931293), (313148087062771144, 1697931393), (313148407970517961, 1697931679), (313148728796237807, 1697932249), (313149049438134854, 1697932590), (313149370304109940, 1697932668), (313149690704713909, 1697932850), (313150010743157329, 1697932945), (313150330737815453, 1697933078), (313150650978371079, 1697933240), (313150972133390209, 1697933359), (313151292371990358, 1697933409), (313151612540461812, 1697933513), (313151932663183423, 1697933774), (313152252143337508, 1697933791), (313152572071330132, 1697933941), (313152891909654382, 1697934038), (313153211869385202, 1697934467), (313153531718448406, 1697934470), (313153851531443528, 1697934551), (313154172558125091, 1697934593), (313154493344152022, 1697934607), (313154812387531936, 1697934656), (313155131282777688, 1697934866), (313155450017243121, 1697935169), (313155769171037571, 1697935282), (313156088519938933, 1697935456), (313156407798852944, 1697935637), (313156726134559442, 1697935955), (313157044710538217, 1697936051), (313157363301592012, 1697936303), (313157682243310822, 1697936371), (313158000233577643, 1697936420), (313158318001247519, 1697936482), (313158635841321493, 1697936494), (313158953725449723, 1697936721), (313159271985394522, 1697937204), (313159590312749187, 1697937217), (313159909236757657, 1697937279), (313160228231482811, 1697937316), (313160545759721675, 1697937360), (313160863529129677, 1697937430), (313161181078289981, 1697937491), (313161497800720680, 1697937623), (313161814612956930, 1697937789), (313162131376663442, 1697937799), (313162447924401858, 1697938055), (313162764863959541, 1697938208), (313163082222679493, 1697938393), (313163399717510619, 1697938436), (313163716525889808, 1697938481), (313164033777207926, 1697938576), (313164351014844097, 1697938701), (313164667605654199, 1697939198), (313164983992538930, 1697939263), (313165300451618481, 1697939419), (313165617208256974, 1697939842), (313165934024620608, 1697939887), (313166252383624877, 1697940065), (313166571104220645, 1697940218), (313166889907563733, 1697940241), (313167207998960622, 1697940597), (313167526808359611, 1697940985), (313167845968010312, 1697941055), (313168165414494155, 1697941075), (313168484824725461, 1697941172), (313168805066402747, 1697941182), (313169125565812212, 1697941373), (313169443750703041, 1697941518), (313169761072957691, 1697941592), (313170078579652151, 1697941613), (313170395569852520, 1697941625), (313170711900718856, 1697941965), (313171027780474820, 1697941966), (313171344695066596, 1697942329), (313171662253915763, 1697942481), (313171978661291166, 1697942507), (313172294685265941, 1697942518), (313172610414882285, 1697942898), (313172924139668289, 1697943104), (313173236706682692, 1697943117), (313173548994676676, 1697943138), (313173861541779010, 1697943311), (313174173789566989, 1697943327), (313174485746188574, 1697943375), (313174797155074169, 1697943380), (313175108602106447, 1697943390), (313175420068825384, 1697943422), (313175731608784751, 1697943485), (313176042186435338, 1697943523), (313176352804647723, 1697943533), (313176662862768897, 1697943614), (313176972555862372, 1697944158), (313177280618381349, 1697944187), (313177588786724140, 1697944210), (313177896680193174, 1697944264), (313178204881731470, 1697944606), (313178513159856376, 1697944673), (313178821766286923, 1697944754), (313179129591309270, 1697944811), (313179436855951279, 1697944945), (313179743740997134, 1697944996), (313180049963350507, 1697945005), (313180355584535393, 1697945057), (313180660019111177, 1697945069), (313180964116795926, 1697945110), (313181268472952971, 1697945362), (313181572831521703, 1697945613), (313181877101231588, 1697945684), (313182181590141468, 1697945977), (313182486136124858, 1697945992), (313182791181295775, 1697946415), (313183094568245873, 1697946460), (313183397970752120, 1697946484), (313183701655514418, 1697946581), (313184005829155302, 1697946625), (313184310114511968, 1697946734), (313184615651801833, 1697946777), (313184920982272835, 1697946853), (313185226388345470, 1697946999), (313185531734643938, 1697947009), (313185837268866596, 1697947254), (313186142282271804, 1697947481), (313186446757881690, 1697947483), (313186751161199590, 1697947667), (313187055424791605, 1697947741), (313187360025384659, 1697947797), (313187665167664162, 1697947896), (313187969964346314, 1697947915), (313188272909532445, 1697948142), (313188576356659326, 1697948288), (313188879306374875, 1697948358), (313189181500034329, 1697948452), (313189483733505926, 1697948700), (313189785336135358, 1697948751), (313190088107585862, 1697948759), (313190390841367706, 1697948923), (313190694166366276, 1697948984), (313190996276537400, 1697949206), (313191298211579122, 1697949213), (313191600790086530, 1697949225), (313191904410669377, 1697949550), (313192208655892540, 1697949579), (313192512426932098, 1697949584), (313192815975016698, 1697949597), (313193119833965354, 1697949753), (313193423646831712, 1697949793), (313193727424797086, 1697950069), (313194030467321777, 1697950166), (313194333510922829, 1697950697), (313194637401566235, 1697950718), (313194940832038133, 1697951030), (313195244165019164, 1697951071), (313195549067033355, 1697951253), (313195853067397670, 1697951303), (313196156430926496, 1697951469), (313196459822606955, 1697951512), (313196763335189325, 1697951742), (313197066444991882, 1697952204), (313197370256718165, 1697952235), (313197674650923193, 1697952417), (313197979102450835, 1697953031), (313198283614342435, 1697953044), (313198588274027482, 1697953327), (313198893042715871, 1697953507), (313199198331787667, 1697953520), (313199503916116559, 1697953617), (313199809185158550, 1697953693), (313200112352554367, 1697953773), (313200417143249744, 1697953793), (313200721948807625, 1697954029), (313201027171731269, 1697954075), (313201331409910421, 1697954251), (313201635523764531, 1697954497), (313201940080620600, 1697955088), (313202244628312397, 1697955143), (313202548660089910, 1697955414), (313202853170964668, 1697955427), (313203157827199116, 1697955453), (313203462456732802, 1697955474), (313203767168128543, 1697955731), (313204071798072621, 1697955866), (313204376083292896, 1697955879), (313204679840745090, 1697956201), (313204983406152695, 1697956265), (313205285894330012, 1697956271), (313205590367182470, 1697956301), (313205893149779039, 1697956343), (313206195861070924, 1697956423), (313206499042071911, 1697956464), (313206802817590663, 1697956488), (313207106716843687, 1697956614), (313207410365525423, 1697956689), (313207713850396156, 1697956999), (313208018316170666, 1697957105), (313208322490371238, 1697957109), (313208626809312207, 1697957353), (313208930242374552, 1697957562), (313209232775023603, 1697957567), (313209536930785195, 1697957615), (313209841166348797, 1697957760), (313210145491208090, 1697957765), (313210449568588094, 1697957841), (313210754614986342, 1697957939), (313211059679472756, 1697958084), (313211363924454557, 1697958189), (313211667988195084, 1697958197), (313211971984914290, 1697958459), (313212276290552996, 1697958520), (313212579721503648, 1697958594), (313212882957476204, 1697958598), (313213190708208462, 1697958852), (313213500642323783, 1697959001), (313213810676570991, 1697959015), (313214120356100363, 1697959156), (313214430461580217, 1697959316), (313214740805237830, 1697959406), (313215050655980583, 1697959525), (313215360386514903, 1697959540), (313215670303787243, 1697959607), (313215980193153498, 1697959827), (313216290324116536, 1697959901), (313216600800160918, 1697960300), (313216910539595617, 1697960314), (313217220399903254, 1697960381), (313217528875556442, 1697960407), (313217837284508609, 1697960501), (313218145169619270, 1697960508), (313218453953289813, 1697960531), (313218762216062046, 1697960554), (313219071454231401, 1697961004), (313219380090769298, 1697961053), (313219688902465242, 1697961080), (313219997031159044, 1697961148), (313220303298718586, 1697961151), (313220609619015788, 1697961327), (313220915394551575, 1697961357), (313221219363161826, 1697961512), (313221523654755581, 1697961648), (313221828470077271, 1697961717), (313222132555083114, 1697961931), (313222436874657903, 1697961972), (313222740884780169, 1697962127), (313223044886480180, 1697962179), (313223348667386450, 1697962588), (313223652464998515, 1697962682), (313223955346098138, 1697962810), (313224258293623328, 1697962872), (313224560813796210, 1697962989), (313224862585754775, 1697963334), (313225162230254292, 1697963358), (313225461965611852, 1697963374), (313225760657510319, 1697963406), (313226061635542440, 1697963718), (313226362751372103, 1697963896), (313226664188358290, 1697963899), (313226964652156699, 1697963912), (313227265907451766, 1697964082), (313227567083773282, 1697964121), (313227867686392080, 1697964191), (313228169973139399, 1697964628), (313228472224702315, 1697964908), (313228774347436319, 1697965073), (313229078672655630, 1697965112), (313229382962565366, 1697965121), (313229687130434963, 1697965345), (313229991613036347, 1697965354), (313230295931580186, 1697965930), (313230600404691235, 1697965957), (313230904047700121, 1697966138), (313231207505841477, 1697966209), (313231511521794003, 1697966331), (313231814546279038, 1697966385), (313232116764857627, 1697966491), (313232419090495663, 1697966555), (313232721386687838, 1697966710), (313233023768991295, 1697966851), (313233326798620841, 1697966924), (313233629945579785, 1697967192), (313233933035623018, 1697967450), (313234236632096942, 1697967459), (313234539950162886, 1697967642), (313234843944862299, 1697967779), (313235147002256837, 1697967802), (313235450847645611, 1697967945), (313235754556091288, 1697968117), (313236058218926576, 1697968546), (313236361012299728, 1697968696), (313236663274723662, 1697968870), (313236965848110593, 1697968876), (313237268470037413, 1697969061), (313237570494242415, 1697969204), (313237872265374425, 1697969432), (313238173566676895, 1697969828), (313238475576235211, 1697970055), (313238779209706187, 1697970110), (313239082008851617, 1697970438), (313239384913462631, 1697970567), (313239686388788710, 1697970602), (313239988235401822, 1697970610), (313240290306003470, 1697970637), (313240592461825923, 1697970713), (313240894962261614, 1697970774), (313241198388538398, 1697970781), (313241501973716552, 1697970955), (313241805534014581, 1697971047), (313242107850164035, 1697971068), (313242409953903673, 1697971098), (313242712130412467, 1697971896), (313243014606567808, 1697971980), (313243317129429018, 1697972026), (313243619208390566, 1697972050), (313243921674971168, 1697972095), (313244223503741084, 1697972180), (313244525117926570, 1697972218), (313244826470460685, 1697972249), (313245127579800792, 1697972420), (313245429252485468, 1697972466), (313245730957269475, 1697972494), (313246032934027239, 1697972515), (313246333307570864, 1697972646), (313246634094084068, 1697972657), (313246934512223425, 1697972820), (313247235191688505, 1697972829), (313247536203509114, 1697973163), (313247836020640299, 1697973240), (313248136645219347, 1697973272), (313248438145486661, 1697973333), (313248739603850822, 1697973361), (313249040242337979, 1697973368), (313249341149453689, 1697973595), (313249642059246336, 1697973599), (313249942937826685, 1697973718), (313250243531791346, 1697973727), (313250544237009985, 1697974185), (313250844689059491, 1697974250), (313251143705406491, 1697974267), (313251442077674349, 1697974272), (313251739922920289, 1697974289), (313252038139736948, 1697974644), (313252336491783859, 1697974657), (313252634035726629, 1697974717), (313252931940159072, 1697974806), (313253227874783213, 1697974859), (313253523731677491, 1697974982), (313253819024589113, 1697975008), (313254114114440086, 1697975145), (313254408734505931, 1697975278), (313254703823946570, 1697975314), (313254998599158251, 1697975336), (313255294911180440, 1697975377), (313255590930300279, 1697975532), (313255886848662589, 1697975534), (313256183152671709, 1697975587), (313256478691148690, 1697975624), (313256774244740512, 1697975655), (313257069743039909, 1697975776), (313257364544825183, 1697975784), (313257661054770616, 1697976092), (313257957674442052, 1697976224), (313258254940225849, 1697976233), (313258551864874482, 1697976306), (313258848114204267, 1697976390), (313259144070780960, 1697976394), (313259439416931321, 1697976562), (313259734713471029, 1697976597), (313260030060196112, 1697976607), (313260325151954853, 1697976650), (313260620067080045, 1697976691), (313260913707179730, 1697976770), (313261206514088706, 1697976846), (313261499415470763, 1697977012), (313261791632627923, 1697977159), (313262083952792443, 1697977142), (313262377616601393, 1697977332), (313262671392917840, 1697977341), (313262965286597574, 1697977438), (313263259226092890, 1697977856), (313263552899529353, 1697978108), (313263847309613734, 1697978150), (313264141304941264, 1697978486), (313264434984424661, 1697978818), (313264728626043597, 1697978822), (313265024471503058, 1697978851), (313265317308531826, 1697979012), (313265609815641848, 1697979020), (313265902511775344, 1697979171), (313266195088801306, 1697979207), (313266488263939223, 1697979294), (313266781224925175, 1697979346), (313267074017211743, 1697979357), (313267367337976814, 1697979380), (313267660714248778, 1697979429), (313267953974866924, 1697979522), (313268247984183084, 1697979716), (313268541894786277, 1697979839), (313268835563380854, 1697979879), (313269129706094791, 1697979983), (313269424484021746, 1697979996), (313269719302904243, 1697980021), (313270012894757685, 1697980030), (313270306413101659, 1697980032), (313270599781497735, 1697980054), (313270892973071510, 1697980105), (313271186032956108, 1697980119), (313271479117338521, 1697980321), (313271771769879708, 1697980379), (313272064478488939, 1697980629), (313272357332891420, 1697980634), (313272650385656021, 1697980935), (313272941984315242, 1697981198), (313273233602892398, 1697981238), (313273525273194250, 1697981256), (313273817009386326, 1697981506), (313274108702213089, 1697981585), (313274399152580208, 1697981672), (313274690063716213, 1697981703), (313274980735788656, 1697981757), (313275271789143629, 1697982551), (313275564021116527, 1697982592), (313275855749648399, 1697982839), (313276147801250493, 1697982885), (313276439647663649, 1697982969), (313276731369380626, 1697982971), (313277022930327534, 1697983307), (313277315483949215, 1697983480), (313277608151664571, 1697983564), (313277900372595649, 1697983745), (313278192572405460, 1697983772), (313278486154669776, 1697983928), (313278780147234239, 1697983964), (313279073996325304, 1697984065), (313279367576537871, 1697984114), (313279661824753660, 1697984398), (313279954859348778, 1697984440), (313280247941114483, 1697984707), (313280541850952481, 1697984714), (313280836345276211, 1697984755), (313281130764214951, 1697984823), (313281425134219708, 1697984825), (313281719161077611, 1697984918), (313282013323128065, 1697984954), (313282307549439131, 1697984999), (313282601557729628, 1697985039), (313282895738020473, 1697985066), (313283189690771035, 1697985288), (313283486863104301, 1697985321), (313283784370661021, 1697985482), (313284081681826772, 1697985533), (313284381182831763, 1697985569), (313284680688120027, 1697985578), (313284982341488301, 1697985601), (313285283793927908, 1697985901), (313285586251150127, 1697986167), (313285888166116794, 1697986170), (313286189856608841, 1697986352), (313286490226690316, 1697986389), (313286789705490627, 1697986411), (313287089116775543, 1697986472), (313287388641852956, 1697986615), (313287687882078524, 1697986645), (313287987126070342, 1697986660), (313288286774412423, 1697986851), (313288586404814707, 1697986861), (313288886156672725, 1697986970), (313289186097149996, 1697986975), (313289486320872597, 1697987237), (313289786406327663, 1697987406), (313290086694340318, 1697987564), (313290386927742932, 1697987617), (313290686708027088, 1697988163), (313290986366516344, 1697988196), (313291288142605545, 1697988310), (313291589636989049, 1697988382), (313291892546803898, 1697988589), (313292195354342811, 1697988604), (313292498755375959, 1697988637), (313292802874601816, 1697988743), (313293106907273332, 1697988831), (313293410918712181, 1697989411), (313293714809246628, 1697989489), (313294018008921144, 1697989517), (313294321100150240, 1697989593), (313294623764454117, 1697989598), (313294927266406443, 1697989664), (313295230199348704, 1697989716), (313295532147083797, 1697989951), (313295834176505346, 1697990079), (313296136180567446, 1697990503), (313296437420279531, 1697990605), (313296739358078235, 1697990676), (313297040924791568, 1697991149), (313297343010907549, 1697991189), (313297645295348000, 1697991474), (313297944378497957, 1697991722), (313298243320305160, 1697991732), (313298541689679420, 1697991755), (313298840208560114, 1697991796), (313299138550695476, 1697991828), (313299437441441294, 1697991969), (313299735287276042, 1697992064), (313300032591897369, 1697992229), (313300329689063042, 1697992541), (313300626081056356, 1697992619), (313300924843015065, 1697992651), (313301222955519360, 1697992664), (313301521236040748, 1697992728), (313301819111053981, 1697992743), (313302116910406831, 1697992863), (313302413875166816, 1697992900), (313302712272753194, 1697993041), (313303011373652827, 1697993089), (313303311172570276, 1697993184), (313303611216245022, 1697993240), (313303910995962369, 1697993304), (313304211351633739, 1697993429), (313304511341415738, 1697993514), (313304812302863338, 1697993580), (313305113748285445, 1697993590), (313305414994880390, 1697993635), (313305716112986410, 1697993725), (313306016813150290, 1697993738), (313306317372158672, 1697993743), (313306617249899222, 1697993809), (313306918030712081, 1697993943), (313307218910137143, 1697993991), (313307519936500896, 1697994032), (313307821653053889, 1697994037), (313308122462503155, 1697994102), (313308422525310341, 1697994107), (313308722584562190, 1697994309), (313309023656013789, 1697994455), (313309325608960621, 1697994547), (313309627497306132, 1697994571), (313309929415010960, 1697994590), (313310231237990399, 1697994932), (313310533809222559, 1697994942), (313310836449998101, 1697994953), (313311138836756384, 1697994983), (313311442699448015, 1697995029), (313311746116116676, 1697995075), (313312051155112511, 1697995385), (313312355766918156, 1697995519), (313312659822879420, 1697995585), (313312963187637512, 1697995627), (313313268070452511, 1697995635), (313313572010089604, 1697996003), (313313876264143926, 1697996027), (313314180159445285, 1697996046), (313314484087686929, 1697996085), (313314787751060680, 1697996181), (313315091432198799, 1697996185), (313315395223219841, 1697996311), (313315698639612790, 1697996414), (313316002249258622, 1697996461), (313316304628764370, 1697996813), (313316606773772621, 1697996969), (313316908778335983, 1697997045), (313317211141476769, 1697997095), (313317514547769395, 1697997285), (313317818267984730, 1697997420), (313318122081022650, 1697997583), (313318425168449304, 1697997589), (313318727705859485, 1697997892), (313319028639028495, 1697997995), (313319329820493778, 1697998045), (313319631228639608, 1697998058), (313319930710067366, 1697998097), (313320230266311108, 1697998237), (313320528666726230, 1697998263), (313320827513907531, 1697998351), (313321126371204518, 1697998390), (313321426154930603, 1697998664), (313321726372430890, 1697998821), (313322026620189072, 1697998836), (313322326366175669, 1697998934), (313322625797001390, 1697999114), (313322924766324064, 1697999168), (313323222500585099, 1697999175), (313323521270776370, 1697999252), (313323820499287217, 1697999257), (313324120390295888, 1697999286), (313324420159248744, 1697999362), (313324720004222590, 1697999873), (313325020522124412, 1698000050), (313325320959626356, 1698000059), (313325621141991809, 1698000076), (313325921927933620, 1698000187), (313326222373342212, 1698000196), (313326523229914427, 1698000500), (313326824115351069, 1698000557), (313327125830880526, 1698000581), (313327428803712930, 1698000635), (313327731813501029, 1698000645), (313328035756275735, 1698000720), (313328339622742981, 1698000722), (313328643172131763, 1698000751), (313328947116910903, 1698000849), (313329251439934461, 1698000871), (313329555716755284, 1698000880), (313329859560254526, 1698000916), (313330164287549026, 1698000920), (313330469391679962, 1698001010), (313330774900509523, 1698001136), (313331080367513386, 1698001166), (313331386446042610, 1698001241), (313331692664190614, 1698001249), (313331998311426824, 1698001570), (313332303540789435, 1698001659), (313332609784602476, 1698001699), (313332917049741795, 1698001871), (313333223002092756, 1698002003), (313333529060197312, 1698002024), (313333835701866931, 1698002202), (313334142241219222, 1698002442), (313334449067961357, 1698002647), (313334755984195856, 1698002700), (313335061772761289, 1698002849), (313335367196139293, 1698002947), (313335672528929795, 1698002964), (313335977946272044, 1698003018), (313336286549229624, 1698003041), (313336593709571885, 1698003112), (313336901046573779, 1698003377), (313337209541568789, 1698003447), (313337517872269001, 1698003579), (313337825886804440, 1698003601), (313338135344085879, 1698004007), (313338444875251458, 1698004019), (313338753972845756, 1698004057), (313339063000088279, 1698004078), (313339372382575914, 1698004400), (313339681813858581, 1698004542), (313339990913868954, 1698004700), (313340299854759448, 1698004747), (313340608631611587, 1698004760), (313340916832756688, 1698005008), (313341225435709041, 1698005194), (313341534461719971, 1698005202), (313341843984177681, 1698005211), (313342153122374671, 1698005314), (313342462701055153, 1698005322), (313342773443069240, 1698005593), (313343084140581940, 1698005656), (313343394873346878, 1698005846), (313343705762676600, 1698005937), (313344016414731333, 1698005940), (313344327380296204, 1698006106), (313344637514792428, 1698006228), (313344947831295400, 1698006278), (313345258625303616, 1698006312), (313345569053025343, 1698006322), (313345879383159128, 1698006829), (313346189826627309, 1698006838), (313346500735666919, 1698006845), (313346811284187179, 1698006958), (313347121995056001, 1698006961), (313347433455035152, 1698007084), (313347744781607186, 1698007135), (313348054015501387, 1698007207), (313348363430541131, 1698007209), (313348672947735045, 1698007234), (313348982378140424, 1698007280), (313349291775253122, 1698007283), (313349601190623410, 1698007310), (313349909420111294, 1698007386), (313350217495603102, 1698007872), (313350528053702120, 1698007988), (313350839474164567, 1698008069), (313351150834952224, 1698008098), (313351462555406476, 1698008106), (313351774988426744, 1698008380), (313352087764095953, 1698008526), (313352400171202931, 1698008577), (313352712474752848, 1698008745), (313353025964913858, 1698008752), (313353339712877813, 1698008904), (313353654710611002, 1698008972), (313353971879812338, 1698009082), (313354290017347497, 1698009148), (313354608350840569, 1698009242), (313354927157247252, 1698009614), (313355246345443024, 1698009620), (313355564632379212, 1698009744), (313355883232585152, 1698009817), (313356202174905104, 1698009943), (313356520526126661, 1698010198), (313356838722292463, 1698010230), (313357158012660840, 1698010300), (313357476529083982, 1698010440), (313357794603570292, 1698010470), (313358112154605825, 1698011034), (313358431432576562, 1698011357), (313358750004163125, 1698011436), (313359068471321490, 1698011644), (313359387027383221, 1698012049), (313359705370226542, 1698012231), (313360023815783371, 1698013026), (313360342889299992, 1698013146), (313360662120526823, 1698013178), (313360981534367706, 1698013356), (313361301125728621, 1698013586), (313361621444876320, 1698013640), (313361941334154272, 1698014171), (313362261602806662, 1698014662), (313362582866208830, 1698014853), (313362904335049767, 1698014964), (313363224497713489, 1698015002), (313363544269349007, 1698015006), (313363863341112572, 1698015313), (313364183241378900, 1698015318), (313364505350407648, 1698015321), (313364826324908702, 1698015469), (313365146695134340, 1698015626), (313365467184596504, 1698015649), (313365787825219852, 1698015663), (313366108294714717, 1698015710), (313366429000508998, 1698015867), (313366749039895225, 1698015954), (313367069554185160, 1698016042), (313367389210005432, 1698016162), (313367709632806661, 1698016199), (313368030754080101, 1698016213), (313368351954129043, 1698016375), (313368672766845497, 1698016444), (313368993544411594, 1698016518), (313369314599415898, 1698016764), (313369636188339188, 1698017026), (313369957718603425, 1698017054), (313370279504768288, 1698017055), (313370601992148317, 1698017295), (313370925957955452, 1698017299), (313371250115698427, 1698017398), (313371574527112642, 1698017482), (313371899419760047, 1698017605), (313372224057530745, 1698017675), (313372550404912443, 1698017738), (313372878523627066, 1698017966), (313373206743622772, 1698017987), (313373535029680214, 1698018050), (313373863645058783, 1698018172), (313374191911061518, 1698018300), (313374518698405312, 1698018369), (313374845614553348, 1698018517), (313375172485623716, 1698018790), (313375499306269516, 1698018885), (313375826137067285, 1698018964), (313376153285610912, 1698019063), (313376479715869845, 1698019233), (313376807675312189, 1698019602), (313377135546048946, 1698019724), (313377463505539243, 1698019945), (313377790764348532, 1698020332), (313378119567137639, 1698020518), (313378448854609483, 1698020574), (313378777887901116, 1698020614), (313379106568809075, 1698020707), (313379434274551745, 1698020732), (313379762042290498, 1698020946), (313380089446143847, 1698021099), (313380416527879948, 1698021216), (313380743053036378, 1698021349), (313381068500126293, 1698021368), (313381394110338608, 1698021750), (313381719580173238, 1698021865), (313382044431787156, 1698022144), (313382369545597378, 1698022303), (313382694576278777, 1698022662), (313383018204352373, 1698022710), (313383341581410248, 1698022923), (313383664238206559, 1698023384), (313383986612025610, 1698023388), (313384308454964188, 1698023738), (313384626949309448, 1698023741), (313384945169778591, 1698023770), (313385263886993855, 1698023883), (313385582034085787, 1698023891), (313385899179351756, 1698024275), (313386216341086310, 1698024283), (313386531147572449, 1698024354), (313386843945167361, 1698024454), (313387157046535750, 1698024498), (313387470809573390, 1698024663), (313387784749496323, 1698024676), (313388100030342126, 1698024683), (313388414008279527, 1698024692), (313388729916835178, 1698024743), (313389046050697008, 1698025025), (313389361646877320, 1698025216), (313389676997804316, 1698025360), (313389992473039785, 1698025728), (313390308411545856, 1698025822), (313390624357713143, 1698025862), (313390939959796610, 1698025880), (313391255857384689, 1698025885), (313391571424408359, 1698026025), (313391887588466766, 1698026071), (313392204653603473, 1698026561), (313392521692444501, 1698027076), (313392838862135826, 1698027148), (313393156083815323, 1698027471), (313393473250653455, 1698027511), (313393789768220543, 1698027582), (313394105202042643, 1698027590), (313394421579119038, 1698027913), (313394738655300537, 1698027925), (313395054983575525, 1698028376), (313395371763318296, 1698028388), (313395689268425623, 1698028413), (313396006660911071, 1698028421), (313396323561783466, 1698028496), (313396640934164482, 1698028690), (313396958337495569, 1698028812), (313397275758520159, 1698028846), (313397593160792024, 1698029006), (313397910372688156, 1698029070), (313398228566680269, 1698029218), (313398546344224547, 1698029302), (313398863866250815, 1698029380), (313399180807004507, 1698029508), (313399497250624581, 1698029545), (313399813482303105, 1698029615), (313400130658374989, 1698029708), (313400447867225806, 1698029777), (313400766787860125, 1698029894), (313401084139245781, 1698030132), (313401402411084389, 1698030489), (313401719894036772, 1698030603), (313402036473658334, 1698030844), (313402352474235793, 1698030916), (313402669022833463, 1698031034), (313402985629702082, 1698031095), (313403302909308178, 1698031236), (313403622255262346, 1698031270), (313403940792531032, 1698031274), (313404259504499619, 1698031958), (313404580579384880, 1698031985), (313404901128870910, 1698032137), (313405222958754831, 1698032305), (313405543872667097, 1698032518), (313405864343071754, 1698032524), (313406183996082691, 1698032531), (313406503297106633, 1698032612), (313406821343047886, 1698032715), (313407139292571695, 1698032726), (313407457380589699, 1698032757), (313407773594183562, 1698032761), (313408090625935791, 1698032900), (313408407212232118, 1698032921), (313408726534392005, 1698032935), (313409046001438153, 1698033152), (313409366231428784, 1698033467), (313409686508706982, 1698033550), (313410005141735060, 1698033625), (313410323856817716, 1698033694), (313410643453418467, 1698033715), (313410963227397172, 1698033881), (313411282872329176, 1698033936), (313411603267822434, 1698034042), (313411923920366634, 1698034050), (313412244590663095, 1698034198), (313412565376101701, 1698034273), (313412886142359695, 1698034631), (313413205987593874, 1698034715), (313413525156673707, 1698034723), (313413843789813817, 1698034859), (313414161327371238, 1698035131), (313414478798991484, 1698035184), (313414797537078382, 1698035209), (313415116702432583, 1698035358), (313415435883601038, 1698035503), (313415755567807288, 1698035518), (313416076034921552, 1698035521), (313416394274557312, 1698035560), (313416710396861902, 1698035595), (313417026874112932, 1698035831), (313417341929791251, 1698035833), (313417657170811028, 1698035884), (313417972553812739, 1698035992), (313418288576353360, 1698036054), (313418603631693842, 1698036121), (313418918691354992, 1698036453), (313419232920510124, 1698036579), (313419547391465810, 1698036761), (313419862107311506, 1698036775), (313420176829457679, 1698036869), (313420492376273328, 1698036886), (313420807732140408, 1698037086), (313421122612712796, 1698037232), (313421437990073829, 1698037524), (313421753379999291, 1698037571), (313422068899465501, 1698037635), (313422384302006416, 1698037638), (313422699406431822, 1698037883), (313423014474258856, 1698037938), (313423329970214169, 1698037945), (313423645644661085, 1698038125), (313423962827404461, 1698038127), (313424279661918303, 1698038544), (313424596500008088, 1698038683), (313424912941205384, 1698039116), (313425228743399356, 1698039453), (313425542983964307, 1698039461), (313425856831334008, 1698040086), (313426169719524527, 1698040191), (313426484311045304, 1698040326), (313426798605951746, 1698040774), (313427112761593658, 1698040830), (313427426605695044, 1698040832), (313427740333426262, 1698040876), (313428054853574687, 1698040877), (313428366482208755, 1698040929), (313428678705981644, 1698041149), (313428990886561506, 1698041217), (313429302658231497, 1698041244), (313429614462927972, 1698041273), (313429926449777525, 1698041517), (313430239119133760, 1698041652), (313430551685818059, 1698041661), (313430865640800867, 1698041770), (313431179992055918, 1698041799), (313431494805330812, 1698041988), (313431809902643225, 1698042115), (313432124925707647, 1698042163), (313432441441079445, 1698042184), (313432758035880839, 1698042248), (313433073752643991, 1698042289), (313433388231010989, 1698042293), (313433703773810562, 1698042314), (313434019812859503, 1698042407), (313434335582760143, 1698042409), (313434651349362602, 1698042662), (313434967165898562, 1698042740), (313435282941800972, 1698042836), (313435598588960951, 1698042952), (313435916218439608, 1698042965), (313436234484912625, 1698043196), (313436553197679097, 1698043329), (313436870476356358, 1698043441), (313437187439930854, 1698044141), (313437505416279966, 1698044215), (313437822836051397, 1698044235), (313438141673170730, 1698044623), (313438460413074468, 1698044685), (313438779899092123, 1698044725), (313439099051987913, 1698044865), (313439418125072642, 1698044993), (313439737407073762, 1698045038), (313440057197199906, 1698045140), (313440377130858154, 1698045163), (313440697645937212, 1698045174), (313441017744119506, 1698045806), (313441338193055646, 1698045898), (313441659675426632, 1698045904), (313441981882864156, 1698046124), (313442303863085904, 1698046462), (313442626409293993, 1698046536), (313442948058966055, 1698046610), (313443269246429748, 1698046681), (313443590270395954, 1698046884), (313443912052360859, 1698046937), (313444235431504980, 1698046991), (313444559463821696, 1698047006), (313444883395668917, 1698047025), (313445206685676412, 1698047039), (313445529492775201, 1698047094), (313445852776615224, 1698047194), (313446176862008696, 1698047247), (313446502850627478, 1698047326), (313446828775903524, 1698047365), (313447154721409014, 1698047503), (313447482239375500, 1698047547), (313447809532778855, 1698047870), (313448137014047036, 1698047872), (313448462550173011, 1698047898), (313448787576526957, 1698048130), (313449110931606786, 1698048436), (313449433010462573, 1698048546), (313449755103523888, 1698048582), (313450075113113133, 1698048792), (313450395078724918, 1698048839), (313450714538936096, 1698048940), (313451032103639090, 1698048942), (313451353107436081, 1698049078), (313451674513348695, 1698049171), (313451995948126904, 1698049260), (313452317512010585, 1698049325), (313452639059165604, 1698049462), (313452959995010243, 1698049480), (313453280809692140, 1698049490), (313453601661094887, 1698049600), (313453923192850588, 1698049970), (313454243820555836, 1698049981), (313454563971216985, 1698050053), (313454884195817322, 1698050145), (313455204545912624, 1698050160), (313455524836152372, 1698050429)] diff --git a/consensus/src/tests/context/difficulty.rs b/consensus/src/tests/context/difficulty.rs index 0664ca80..25a406b9 100644 --- a/consensus/src/tests/context/difficulty.rs +++ b/consensus/src/tests/context/difficulty.rs @@ -4,7 +4,11 @@ use proptest::{arbitrary::any, prop_assert_eq, prop_compose, proptest}; use cuprate_helper::num::median; -use crate::{context::difficulty::*, tests::mock_db::*, HardFork}; +use crate::{ + context::difficulty::*, + tests::{context::data::DIF_3000000_3002000, mock_db::*}, + HardFork, +}; const TEST_WINDOW: usize = 72; const TEST_CUT: usize = 6; @@ -45,6 +49,42 @@ async fn genesis_block_skipped() -> Result<(), tower::BoxError> { Ok(()) } +#[tokio::test] +async fn calculate_diff_3000000_3002000() -> Result<(), tower::BoxError> { + let cfg = DifficultyCacheConfig::main_net(); + + let mut db_builder = DummyDatabaseBuilder::default(); + for (cum_dif, timestamp) in DIF_3000000_3002000 + .iter() + .take(cfg.total_block_count() as usize) + { + db_builder.add_block( + DummyBlockExtendedHeader::default().with_difficulty_info(*timestamp, *cum_dif), + ) + } + + let mut diff_cache = DifficultyCache::init_from_chain_height( + 3_000_720, + cfg.clone(), + db_builder.finish(Some(3_000_720)), + ) + .await?; + + for (i, diff_info) in DIF_3000000_3002000 + .windows(2) + .skip(cfg.total_block_count() as usize - 1) + .enumerate() + { + let diff = diff_info[1].0 - diff_info[0].0; + + assert_eq!(diff_cache.next_difficulty(&HardFork::V16), diff); + + diff_cache.new_block(3_000_720 + i as u64, diff_info[1].1, diff_info[1].0); + } + + Ok(()) +} + prop_compose! { /// Generates an arbitrary full difficulty cache. fn arb_full_difficulty_cache() diff --git a/helper/src/num.rs b/helper/src/num.rs index 34dd1fc5..cc1feb1b 100644 --- a/helper/src/num.rs +++ b/helper/src/num.rs @@ -87,11 +87,27 @@ where /// If not sorted the output will be invalid. pub fn median(array: impl AsRef<[T]>) -> T where - T: Add + Sub + Div + Mul + Copy + From, + T: Add + + Sub + + Div + + Mul + + PartialOrd + + Copy + + From, { let array = array.as_ref(); let len = array.len(); + // TODO: use `is_sorted` when stable. + debug_assert!(array + .windows(2) + .try_for_each(|window| if window[0] <= window[1] { + Ok(()) + } else { + Err(()) + }) + .is_ok()); + let mid = len / 2; if len == 1 {