From 415263dbffc6250c1e41b1ab16910908600b9c92 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 30 Jul 2024 08:31:59 -0700 Subject: [PATCH 1/5] fix(ci): use static preparams for zetaclient by default (#2587) --- Dockerfile-localnet | 1 + contrib/localnet/preparams/zetaclient0.json | 1 + contrib/localnet/preparams/zetaclient1.json | 1 + contrib/localnet/preparams/zetaclient2.json | 1 + contrib/localnet/preparams/zetaclient3.json | 1 + contrib/localnet/scripts/start-zetaclientd.sh | 13 +++++++++---- 6 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 contrib/localnet/preparams/zetaclient0.json create mode 100644 contrib/localnet/preparams/zetaclient1.json create mode 100644 contrib/localnet/preparams/zetaclient2.json create mode 100644 contrib/localnet/preparams/zetaclient3.json diff --git a/Dockerfile-localnet b/Dockerfile-localnet index efd2ac8b4f..8dcace1fbe 100644 --- a/Dockerfile-localnet +++ b/Dockerfile-localnet @@ -46,6 +46,7 @@ ENV PATH /root/.zetacored/cosmovisor/current/bin/:/root/.zetaclientd/upgrades/cu COPY contrib/localnet/scripts /root COPY contrib/localnet/ssh_config /etc/ssh/ssh_config.d/localnet.conf COPY contrib/localnet/zetacored /root/zetacored +COPY contrib/localnet/preparams /root/static-preparams COPY cmd/zetae2e/config/localnet.yml /root/config.yml RUN chmod 755 /root/*.sh && \ diff --git a/contrib/localnet/preparams/zetaclient0.json b/contrib/localnet/preparams/zetaclient0.json new file mode 100644 index 0000000000..9dc290e82a --- /dev/null +++ b/contrib/localnet/preparams/zetaclient0.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":19999163952130747960789760351783788437756051987951355569970036401244501934315272438705577988944467922102492970155408252851533852794097112218266886553586076347804115557757017279985449126837870194546917950194158856088817869376589018796114667864086028598566847973861695589083004303196605694312963960967331453606698750471421102641235873021677307589731091486775521460999458082171513731685071918681293270385071153104334613903503586831444874346531652054016464538970392294909014876824634633871501554184148693655829401315639013286485392467863637678737554558389111485917683916225530045382764297294039119124600051351150814211249,"LambdaN":9999581976065373980394880175891894218878025993975677784985018200622250967157636219352788994472233961051246485077704126425766926397048556109133443276793038173902057778878508639992724563418935097273458975097079428044408934688294509398057333932043014299283423986930847794541502151598302847156481980483665726803207844439805564908826908299383131049732286281017413122919529611290634931314211468373848862938241694978602167585393762136625122435580962508878486729843009777923588471302593033407043805894076580681612304239013813560948585228383852537633607722118782082256871296347729191161115127804109535019576521175406883452282,"PhiN":19999163952130747960789760351783788437756051987951355569970036401244501934315272438705577988944467922102492970155408252851533852794097112218266886553586076347804115557757017279985449126837870194546917950194158856088817869376589018796114667864086028598566847973861695589083004303196605694312963960967331453606415688879611129817653816598766262099464572562034826245839059222581269862628422936747697725876483389957204335170787524273250244871161925017756973459686019555847176942605186066814087611788153161363224608478027627121897170456767705075267215444237564164513742592695458382322230255608219070039153042350813766904564},"NTildei":27751913785731317561401314588152253217728532341018033146570952349857948266439815804220817588815467446516307716665513549241775208783937988610417256936545867146994706743041371293345131680171448151086694170309671283486292778243426639412725044938992517873701725006330137070569134489394538234586796972674797327961558527707455425675762370744764931280145514019295136133284528084915871623701598565821330577968131284073671734400158797160800982150954634593880871530904229027402996176777363730066986245815341196905861357768072141609870245229405943812356754513322852513347434681734563805660510650984453048567481135942146732097813,"H1i":27561956258855841139395484606566450906572976054374340673395795572404700162978995778059515299485228139352425772962548084873215102616280128304708426026182349406021553685331715999823302504724574932475811252902805356309567749243825500782237349965272997278195732138043060594209278009387869413139123717258217760369558773026393837335151469655513584729163915760124835545159150578571574024242102852384898501031964398164508802427280019310461284676702762930983763592670681066746406519089087470866348555388978893174745329039290345402036056193885195412683078301439714912339014313158992229100758385774991450029591789628252080327559,"H2i":3728689158497086873141839685259803753136983319082693856963169726229733672131113136177490814524417255268612620467671366860707614533735757821359190975354246119660178366078082228715114521844446138293061922109534401626012196214235577165710689292018952534202208597250579673907469566293203565367500274532873330046549157395771416744602137701132458921345439713375591947533341059776041205066197520027367159385233699483111938755605800865028185017605864002287172205806900860500164647247828301974000635262077178937664668984154402040254899639546189675216600248280397892382489630326684820331235755629614367050680421011963919488203,"Alpha":12023422531214934687129519427336751009035984170561091401995316889932876861127740921311384022403289655727852687123651207179666808127441651093217171624401095992093222930319273470697036100721360499771918420525219595960686726656705243231703751035078246024613303037202379961560592763983837502239948740870420991159486603826605562036000339449263579950064527369636354957917745420111193837730149039024242588057472210146671375468285242828724250764829561800066210708917523476384078739610379308948169897901580561000198663019628193284829226489567395610248716149143318042255879731755585576865932443849122426445714440683236201534278,"Beta":5216977155731439778993461291447860640876449566364806008925260703987381460229691893122780873808995223223163744678138135687392695130955126431701144250850716493320323144762645954407840190267536639011747593827794567732053411766358287215370001772078774800656600220349293422391251849464836894526916992757090542649120892603149475768335549307299570724464502418555347605473575788163359985939167794314377636554352661162839551390523751777303683251484579852979700993668013952132183651009302732527581967714766865349243790338837470546064122938436752503268419712265039843732584942630907069295257952472051299690267622482814099402925,"P":88381187817350292364427405327147330703367287364982016684112982632296448146824918798880619726847439553397534386831375002209019191421648634648182506013318106307619159619988111117766095040541079223450318951393068166232842380382197780515682551401156068869281037660390394768227141311012971150741063274439667450459,"Q":78500624598652662628885184600358941803683076507070394222241292020467077683298789581328374906370256776628646773897006681776229150698724417192594456702517705509422164083826765704615434585654776671817770799114758241307176860136745886869834508666912875775642490370066102181451552981996440342363450244264823933513} diff --git a/contrib/localnet/preparams/zetaclient1.json b/contrib/localnet/preparams/zetaclient1.json new file mode 100644 index 0000000000..2be1ed2553 --- /dev/null +++ b/contrib/localnet/preparams/zetaclient1.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":25457323703460371644373827851778353435908685545536291211414305927928082101422802375380956856518622585962127533562602337812505686541014270487215858975042050235822544248116017505877597933410473464293488133847473268207855779565258437349543414395202677572215574814178481625691319056806051001296935063337564959613946853301319882243101806634616304952340762437957311109361139537003343727266144726020980226387527399976767399929714573852847006597083854380782298222809663705175454809775894834259259463209475055228451410224743854216982482304542678812902450978087467239914333938758325149969031218172033710990345090457725286155369,"LambdaN":12728661851730185822186913925889176717954342772768145605707152963964041050711401187690478428259311292981063766781301168906252843270507135243607929487521025117911272124058008752938798966705236732146744066923736634103927889782629218674771707197601338786107787407089240812845659528403025500648467531668782479806813742728801761583826250346152597916461665330341417210865403249207688068024511779741700862572325893119988056196796737754342005501326839164137901466935886175203187779468543295518513474790300431685405399522582870280178201647350255071127607420848021324546760642117122537154772656918409371952846795161211096663722,"PhiN":25457323703460371644373827851778353435908685545536291211414305927928082101422802375380956856518622585962127533562602337812505686541014270487215858975042050235822544248116017505877597933410473464293488133847473268207855779565258437349543414395202677572215574814178481625691319056806051001296935063337564959613627485457603523167652500692305195832923330660682834421730806498415376136049023559483401725144651786239976112393593475508684011002653678328275802933871772350406375558937086591037026949580600863370810799045165740560356403294700510142255214841696042649093521284234245074309545313836818743905693590322422193327444},"NTildei":31003307508440219158999589043691487475214403045663899026562678761033723312134301775994380397340895347768030057673125775357231348422303424896353372086256383810227518020752599051565951084967114983497141943098598166478211002761519017923016106288584503911326974632855330677820271330604647920436680600523891654973049735964884221470375561066575855880397950409200861685776119732740086942459996794425002691495469612824702455527096404118964381427191733411202093448946116508668456394085348340248206727068840446659229676204271387087603945932130347573000387228525030313172082417029388909317895370107946248250389259192939259646373,"H1i":29730781813111470699934807288606362535555403609772197456284708278048318668560878554383640323066445987663910908767622165095208826200954479561618790257205915675265313818311406127354779480712133033757720117675176405209288959380537060324636594245427706556416191726066471708498586277817285426928723609835008292084080538753201459376063902969706701667490664316841101595224876802504424746310838127241020823651213324579929066785699769578466699967727020306527057185084909523713197830576987072076454405267486608354440156452125172049093160628840221888272116013199116569214013996185637140923602034201009095696719910965705509595628,"H2i":12200384646752241579976259232098382970354307093774030710374960853644929313996225667617076305138824200773395277988919040236132937185396549369542935161875239756505104586544650297790923215288275058570897362869526446130788732811419766964967017276835348423627008837126215741085123016383332325940852408958853934412660510399824892196781693463027372430631217410650810103238763962451284514557282305008205599104191305801679939664630511491104063421807413639454177358852485226094888248161852164965603640486367659690376830772115600055051084107277861489152742292666390189224297716658768411431609911050704684657056556256880423460720,"Alpha":23300332876750103251237227048574590447379913613801272532510124473429290803423083502519971525286552461123759545660655175778475870822505963454261353216519202487193991965727706655186149989210433307949335555781095473402129935487138335217727216010693458515412245634171842581789827295651289821360488007487964832106572899411501524661082029651405344976795845601445316988216903250571350759750576439029949066040378122825697646020303266281537414096152018885734405360710523281142001267367333050504719641543727352974857213863243815562886691272109948010274169422250246450363769598849743993620978664009452648618822005892530117258331,"Beta":2534166047927725318791824172960116917843552215198638103113341163149480377420794251969714143317821379007540482042224193838130003513451297431890471730220885012611873831522777203112446040094780679969632641496751708336325873664082610525199122457113594337055192019447867932328462775220808663006226587292783781575807764223231652099385754554392612251410033887803313530798155833464721706318951078993085347388584140925234192526386132621123852980528239207267316340547156121756913368570362018641312552624302645212896157759221578143866925272746510890569411763813137743560164449226748489921792886205456032275022834591087160894226,"P":87684154738782061313086116044988283754424865443628906617900867296710397990202299345969131805991045014484552915164110726741382733873591202211268387486059703034486515933653465335272146440122553059167795953572936286393083071233554350198604012555120691245736319562861114254514671981751300817893308115225453100769,"Q":88394840552439295667689495221446852363776378041526739827159374682867725531676627667306940267946516555020832447263729538790333494892600936388335911397214533753404105427634220284214242509326156781414204453275659894960381505509021581782161299618850107279147574642362786241754680954729961565957066332054718790203} diff --git a/contrib/localnet/preparams/zetaclient2.json b/contrib/localnet/preparams/zetaclient2.json new file mode 100644 index 0000000000..7955735dc1 --- /dev/null +++ b/contrib/localnet/preparams/zetaclient2.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":23648858955628625457588191386772191443876742421598853948139232115864334590574691090640780364052098584804033205998934169972985598877888287109862320756007213360367211635180623187433217993315211785379304492894323205990488699772149185296963160049456079775393087510342535015098614767311641505579391240770657817635322767929367419584708250343517714707329894363543882421347285382182675118149379718255888348980116939188466774508869818256355305106906160413809967400001118506856318482612747726688234325163812279115000009774919103223049606824994548277772462468827762522318241588067162028257230107577505173237765396246221822329481,"LambdaN":11824429477814312728794095693386095721938371210799426974069616057932167295287345545320390182026049292402016602999467084986492799438944143554931160378003606680183605817590311593716608996657605892689652246447161602995244349886074592648481580024728039887696543755171267507549307383655820752789695620385328908817506628925259155914651064163582274420481622848370823424744709093489084769514819892448481550857731547678219597804001699813599162782662449929749800268252229695789995326315691669007496785216103492408107371530474677606211364074642844133605350010952361161551686115251857512495194405949462158178250652595226119566626,"PhiN":23648858955628625457588191386772191443876742421598853948139232115864334590574691090640780364052098584804033205998934169972985598877888287109862320756007213360367211635180623187433217993315211785379304492894323205990488699772149185296963160049456079775393087510342535015098614767311641505579391240770657817635013257850518311829302128327164548840963245696741646849489418186978169539029639784896963101715463095356439195608003399627198325565324899859499600536504459391579990652631383338014993570432206984816214743060949355212422728149285688267210700021904722323103372230503715024990388811898924316356501305190452239133252},"NTildei":20958522297622482209807759516857687110666693723708307621411395827112192841625205279619780886454329904672254793741201452279600512072929362962340097925181757382133759418398620446989633648738416137994839114584228498763290794293804873491121222670445591900962355888888787875296912853045868588243030176162136939975493385203754811297318997026852191940348618189391652417765667767789106438385230992014424674147889477543437303185992233113994545932642444624948922266541050077971406838334630911259578342037102813364914579164261765823363786889015670104597548538194888464478764027297358349252027521566202538317074702040651632113369,"H1i":5109689099868080446160536255769086332567584927184079439787252270096934236613063255201492544124078902906922503306802121090945560238061120571827553794939932252483206581418021765834430579158012299196878969664308905784947890460405399350349444965894778432384696983001011507880344123705964748574014787390377088881157801740216761481891319913296696524807305643822589206391062602348094175161618070295545114266090714478357141494900596315028405682549679497842106376522837435982709104269696765081172208291259963576432173631469456218471678349286179009205561253446217331889023689880316550109752582816906322747212721617014078333138,"H2i":3824094184703589453276072977703627898610439188014373704777672006240826452074712760308340661359963853738198889389767384577056780875329696683392749021178110545327383952784611702230265307890522393962865182170693326682264121125865915032459888970016362380638793056377490334414109711097183685934105072079174895304506983836308389011663151742344838079170762079122663752419646132355686592709382550940831039596241010756053305442994265928016068485619118864155581724408186051271157659621166113194851410749340272112783780933544348278427775177581314927650507829781537821055940573071178206205843750318246773270418273122284099764678,"Alpha":403358987071588456201445672364843658921586724121591094963899038063303191751684899828027834117123229987962370900405566219864220515579304055898682870316774771141115539367865452501031859537600117114290142996496082111091916314732610135214072170151317308415046500958631818792757910046052760485773723705194675596064908926299174260868997561490397578616761630440050560787151182933005614199833735249247518905154781257307105310390455987737879040823843796323035981084555921630829282547953008250113460599903536129806875829695842519521316369104540028197556524157183195492086739949682819803768730850297218913144185901216901423419,"Beta":365593763336023365651425993423868835916263375013196585172088021197430706277717007452044647976197718410568417901726431212606021826797635994384253312159748273620290235507109723473802025667352948946670717835457232457793541707269707116648767380223383310273764429997673315078013487640110706559049315579176007267011150621914976556333527177780449583799863102148551856664514489404903925699364546632948110887000853454606426216661835156917846539208349124891487776807592183247253398088838610313577557335903243666040353501272443723046605683212468747172714752925390623509936367693809844146568853425426878137100970535159499255568,"P":72250205107385728156329780940876331268051742941970649262434617603343421972939482214146481747484014300599578219593928276536716725180587786673096406714005410102035731106919659107120120270212449699635561797272106831611132732196041827234221287077092396443212393838006775297650940214899374861536677833667983621603,"Q":72520632524405150441595016039887651929144579330692004442054916915653308278013716662619960235531861873166954938997698512177747111307625256091349945377725166180916919387515785018482666596395621922749892453442563274493438865445735819893995561495078491272413437716547842889768483771151828143360239365405744372783} diff --git a/contrib/localnet/preparams/zetaclient3.json b/contrib/localnet/preparams/zetaclient3.json new file mode 100644 index 0000000000..3cfa9be2a7 --- /dev/null +++ b/contrib/localnet/preparams/zetaclient3.json @@ -0,0 +1 @@ +{"PaillierSK":{"N":21753876306313815662588087039028514382826507798262041565902982806598174060469097304541769885763567428569530242034784232534000696169566980243136350627321146541314127885595489732478871033716592343016075435355452122330767977189004353149496260058858637827462582953226377377659039596608777957973290653888979312920516554149814758278574414666158545079307795218785130744154819102117749705840919310233856024520311820547272832486043896206931451943387797560883049383529868580367685685667196368085217651446433183323600608631264268025783455791952811957057630970739868642990024755288382191995930905807002633988201926774239462262601,"LambdaN":10876938153156907831294043519514257191413253899131020782951491403299087030234548652270884942881783714284765121017392116267000348084783490121568175313660573270657063942797744866239435516858296171508037717677726061165383988594502176574748130029429318913731291476613188688829519798304388978986645326944489656460110567222973853734418516092625468876723818678420926419419038507872285530310975332277922153028444244552066616246840208866669648004652879786193866998335160025681466314303608286858794222172905559482726315419134488147799899255152223254681124623491783997493259204421076666735359395687821517231815240385222028516706,"PhiN":21753876306313815662588087039028514382826507798262041565902982806598174060469097304541769885763567428569530242034784232534000696169566980243136350627321146541314127885595489732478871033716592343016075435355452122330767977189004353149496260058858637827462582953226377377659039596608777957973290653888979312920221134445947707468837032185250937753447637356841852838838077015744571060621950664555844306056888489104133232493680417733339296009305759572387733996670320051362932628607216573717588444345811118965452630838268976295599798510304446509362249246983567994986518408842153333470718791375643034463630480770444057033412},"NTildei":24260621986934894124969626367616403625603412702532002793121737944600176849805061756998659622098747633924983257636203479042941916674820080278941139538793022232716179815287034195757809070912379799103788701974622563609519122438590772247917596836793969732152576871644869184772033475586612250574291175350822764453884774010926809961467205367406634969476374658022638594216262398768738269792831286288931218400288108551775499661163834400386584616198454691751318919072772453881485047104474360900316622333122856356800266473799554384305361515179743611863294120021586909294906491469377626385894574710621086408276892189722577506849,"H1i":5765471406001060781321577178558603443522764461801649228644482501928615351943828726647067613407291931938456196029819131958433921811834519383439615652125566062108517595254434202585520725918458539650829611359906765649588876933069244900503743779957722205401652112799388769959315574963861799346623992179296812259108512120682902363605777290798387279703060866846190527558754540944004025669889182402130711051994547424947465848311097872058264068264847883302814930546814509196138468589465110378896941398104531133441169885749142287817235614162212537129367684226889834353016992347371767689577099973152384856154921470842340609440,"H2i":13248076109800665469593810622719225502034768318277483018263693642187250618832552829080364379294987051479503793767958094397864222449722505944252701999223425055634923926237370470982156904748484641055882829739274419766142360133464208567250462282877978030879964096066657152108997164557232745990125568297265347801334911454843872417470925322427408725733589015190657409390596754236317010520232686262328847585710830812639495417877966446490298931635599170573064212526961050707936186722270771009657726606965398426725913421261248838826460745873909371448250697598806763783080833425863062403039913803567383221386972419419382976826,"Alpha":18462405526887919865545155849471766186599587820278228502134585515184526131150630703061956418002947703995062977027748808417033945513306979470746255795774997923957337702604617215611885646144358621346101126449123083330067178276213967454833418565658278757978219923186764710442221649754942924977610640847987230019839733787728557189291779267774518176250222724619645559678442357085927681807757055805549792941365193910082816045554295507286321570914925968892626033251553365817524206817760323640196878009227545160591446053818315974810547625672619543716071058287058884144816630763414174708650897710662822999640645173800018653221,"Beta":1429913922854495484075164077172231537041798673392692054168381388920937923051472026736600648681839975302763780951378731902324765131763911908568833503423773456149523938164072252282486164059731813002194341978761252717289831153831286393667796900316723580171967625417278152306356668052770617502747079397572606559275307222452666125825842415793107024193944337960680527312794164583189658388348765076298799696009572118455188779414852680237339024760719259079238031237542103736413560790515107480231245162701093410860792468523251918769151182358823233381431993231319450443741382536143710728710355878800739118210773121451375904013,"P":72198038811472636386819145284002882962985025633289600640684386221873161724939238359793709956852317052085086520668678160660824485742685496099068043857977938326882557402973989895480775128070314428066843983321552127922793878258934593560477986131553237785383592836252607797792226456757856580055145941688232468861,"Q":84007205688389688038268246876633594660472993846606243250776906606448406376486738741891900213586069402455906606766420548280187082244432211112119353536676511843676678178417693927680436975944782140020243974926366756213564009523117668835831522979261286060994164078613742602246511159941849840256385604289986923081} diff --git a/contrib/localnet/scripts/start-zetaclientd.sh b/contrib/localnet/scripts/start-zetaclientd.sh index fea6b69779..9250385853 100755 --- a/contrib/localnet/scripts/start-zetaclientd.sh +++ b/contrib/localnet/scripts/start-zetaclientd.sh @@ -14,11 +14,16 @@ set_sepolia_endpoint() { jq '.EVMChainConfigs."11155111".Endpoint = "http://eth2:8545"' /root/.zetacored/config/zetaclient_config.json > tmp.json && mv tmp.json /root/.zetacored/config/zetaclient_config.json } -# generate pre-params as early as possible -# to reach keygen height on schedule PREPARAMS_PATH="/root/preparams/${HOSTNAME}.json" -if [ ! -f "$PREPARAMS_PATH" ]; then - zetaclientd gen-pre-params "$PREPARAMS_PATH" +if [[ -n "${ZETACLIENTD_GEN_PREPARAMS}" ]]; then + # generate pre-params as early as possible + # to reach keygen height on schedule + if [ ! -f "$PREPARAMS_PATH" ]; then + zetaclientd gen-pre-params "$PREPARAMS_PATH" + fi +else + echo "Using static preparams" + cp "/root/static-preparams/${HOSTNAME}.json" "${PREPARAMS_PATH}" fi # Wait for authorized_keys file to exist (generated by zetacore0) From 8a043d3021a3f74b508f2a79c99f17f000988edc Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Mon, 29 Jul 2024 02:43:27 -0700 Subject: [PATCH 2/5] refactor: move localnet monitoring to profile (#2574) Co-authored-by: Lucas Bertrand --- Makefile | 42 ++-- .../localnet/docker-compose-monitoring.yml | 43 ---- contrib/localnet/docker-compose.yml | 91 ++++++++ .../grafana/dashboards/log_browser.json | 212 ++++++++++++++++++ contrib/localnet/grafana/datasource.yaml | 6 +- contrib/localnet/grafana/get-tss-address.sh | 9 - contrib/localnet/promtail/config.yaml | 19 ++ 7 files changed, 343 insertions(+), 79 deletions(-) delete mode 100644 contrib/localnet/docker-compose-monitoring.yml create mode 100644 contrib/localnet/grafana/dashboards/log_browser.json delete mode 100755 contrib/localnet/grafana/get-tss-address.sh create mode 100644 contrib/localnet/promtail/config.yaml diff --git a/Makefile b/Makefile index 0cbdff1614..a739e22460 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ VERSION := $(shell ./version.sh) COMMIT := $(shell [ -z "${COMMIT_ID}" ] && git log -1 --format='%H' || echo ${COMMIT_ID} ) BUILDTIME := $(shell date -u +"%Y%m%d.%H%M%S" ) DOCKER ?= docker +# allow setting of DOCKER_COMPOSE_ARGS to pass additional args to docker compose +# useful for setting profiles +DOCKER_COMPOSE ?= $(DOCKER) compose $(COMPOSE_ARGS) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf GOFLAGS:="" @@ -209,11 +212,11 @@ start-localnet: zetanode start-localnet-skip-build start-localnet-skip-build: @echo "--> Starting localnet" export LOCALNET_MODE=setup-only && \ - cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) -f docker-compose.yml up -d # stop-localnet should include all profiles so other containers are also removed stop-localnet: - cd contrib/localnet/ && $(DOCKER) compose --profile all down --remove-orphans + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile all down --remove-orphans ############################################################################### ### E2E tests ### @@ -236,37 +239,37 @@ solana: start-e2e-test: zetanode @echo "--> Starting e2e test" - cd contrib/localnet/ && $(DOCKER) compose up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) up -d start-e2e-admin-test: zetanode @echo "--> Starting e2e admin test" export E2E_ARGS="--skip-regular --test-admin" && \ - cd contrib/localnet/ && $(DOCKER) compose --profile eth2 -f docker-compose.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile eth2 -f docker-compose.yml up -d start-e2e-performance-test: zetanode @echo "--> Starting e2e performance test" export E2E_ARGS="--test-performance" && \ - cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) -f docker-compose.yml up -d start-e2e-import-mainnet-test: zetanode @echo "--> Starting e2e import-data test" export ZETACORED_IMPORT_GENESIS_DATA=true && \ export ZETACORED_START_PERIOD=15m && \ - cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose -f docker-compose.yml up -d + cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER_COMPOSE) -f docker-compose.yml up -d start-stress-test: zetanode @echo "--> Starting stress test" - cd contrib/localnet/ && $(DOCKER) compose --profile stress -f docker-compose.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile stress -f docker-compose.yml up -d start-tss-migration-test: zetanode @echo "--> Starting migration test" export E2E_ARGS="--test-tss-migration" && \ - cd contrib/localnet/ && $(DOCKER) compose up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) up -d start-solana-test: zetanode solana @echo "--> Starting solana test" export E2E_ARGS="--skip-regular --test-solana" && \ - cd contrib/localnet/ && $(DOCKER) compose --profile solana -f docker-compose.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile solana -f docker-compose.yml up -d ############################################################################### ### Upgrade Tests ### @@ -290,13 +293,13 @@ start-upgrade-test: zetanode-upgrade @echo "--> Starting upgrade test" export LOCALNET_MODE=upgrade && \ export UPGRADE_HEIGHT=225 && \ - cd contrib/localnet/ && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d start-upgrade-test-light: zetanode-upgrade @echo "--> Starting light upgrade test (no ZetaChain state populating before upgrade)" export LOCALNET_MODE=upgrade && \ export UPGRADE_HEIGHT=90 && \ - cd contrib/localnet/ && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d start-upgrade-test-admin: zetanode-upgrade @@ -304,7 +307,7 @@ start-upgrade-test-admin: zetanode-upgrade export LOCALNET_MODE=upgrade && \ export UPGRADE_HEIGHT=90 && \ export E2E_ARGS="--skip-regular --test-admin" && \ - cd contrib/localnet/ && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d start-upgrade-import-mainnet-test: zetanode-upgrade @echo "--> Starting import-data upgrade test" @@ -312,20 +315,7 @@ start-upgrade-import-mainnet-test: zetanode-upgrade export ZETACORED_IMPORT_GENESIS_DATA=true && \ export ZETACORED_START_PERIOD=15m && \ export UPGRADE_HEIGHT=225 && \ - cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d - -############################################################################### -### Monitoring ### -############################################################################### - -start-monitoring: - @echo "Starting monitoring services" - cd contrib/localnet/grafana/ && ./get-tss-address.sh - cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-monitoring.yml up -d - -stop-monitoring: - @echo "Stopping monitoring services" - cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-monitoring.yml down + cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d ############################################################################### ### GoReleaser ### diff --git a/contrib/localnet/docker-compose-monitoring.yml b/contrib/localnet/docker-compose-monitoring.yml deleted file mode 100644 index 89ddd0d7c3..0000000000 --- a/contrib/localnet/docker-compose-monitoring.yml +++ /dev/null @@ -1,43 +0,0 @@ -services: - grafana: - image: grafana/grafana:latest - container_name: grafana - hostname: grafana - volumes: - - ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml - - ./grafana/dashboards/:/etc/grafana/provisioning/dashboards - ports: - - "3000:3000" - networks: - mynetwork: - ipv4_address: 172.20.0.30 - - prometheus: - image: prom/prometheus:latest - container_name: prometheus - hostname: prometheus - volumes: - - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - networks: - mynetwork: - ipv4_address: 172.20.0.31 - - zetachain-exporter: - image: zetachain/zetachain-exporter:latest - container_name: zetachain-exporter - hostname: zetachain-exporter - volumes: - - ./grafana/addresses.txt:/app/addresses.txt - ports: - - "9015:9015" - networks: - mynetwork: - ipv4_address: 172.20.0.32 - environment: - - GETH=http://eth:8545 - -networks: - mynetwork: - ipam: - config: - - subnet: 172.20.0.0/24 \ No newline at end of file diff --git a/contrib/localnet/docker-compose.yml b/contrib/localnet/docker-compose.yml index 928a9fe5a7..6eece58fce 100644 --- a/contrib/localnet/docker-compose.yml +++ b/contrib/localnet/docker-compose.yml @@ -291,6 +291,97 @@ services: - UPGRADE_HEIGHT=${UPGRADE_HEIGHT-} volumes: - ssh:/root/.ssh + + grafana: + image: grafana/grafana:9.1.7 + container_name: grafana + hostname: grafana + profiles: + - monitoring + - all + volumes: + - ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml + - ./grafana/dashboards/:/etc/grafana/provisioning/dashboards + - grafana_storage:/var/lib/grafana + ports: + - "3000:3000" + networks: + mynetwork: + ipv4_address: 172.20.0.30 + depends_on: + - prometheus + + prometheus: + image: prom/prometheus:v2.53.1 + container_name: prometheus + hostname: prometheus + profiles: + - monitoring + - all + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + networks: + mynetwork: + ipv4_address: 172.20.0.31 + depends_on: + zetacore0: + condition: service_healthy + + zetachain-exporter: + image: zetachain/zetachain-exporter:v2.0.6 + container_name: zetachain-exporter + hostname: zetachain-exporter + profiles: + - monitoring + - all + ports: + - "9015:9015" + networks: + mynetwork: + ipv4_address: 172.20.0.32 + environment: + - ETH_EVM_URL=http://eth:8545 + - ZETA_EVM_URL=http://zetacore0:8545 + - ZETA_LCD_URL=http://zetacore0:1317 + - ZETA_TENDERMINT_URL=http://zetacore0:26657 + - ETH_CHAIN_ID=1337 + - ZETA_CHAIN_ID=7001 + - REFRESH_INTERVAL=15 + - FAST_REFRESH_INTERVAL=1 + depends_on: + zetacore0: + condition: service_healthy + eth: + condition: service_started + + loki: + container_name: loki + image: grafana/loki:3.1.0 + hostname: loki + profiles: + - monitoring + - all + networks: + mynetwork: + ipv4_address: 172.20.0.33 + command: -config.file=/etc/loki/local-config.yaml + + promtail: + container_name: promtail + image: grafana/promtail:2.9.9 + hostname: promtail + profiles: + - monitoring + - all + networks: + mynetwork: + ipv4_address: 172.20.0.34 + volumes: + - ./promtail/config.yaml:/etc/promtail/config.yaml:ro + - /var/run/docker.sock:/var/run/docker.sock + command: -config.file=/etc/promtail/config.yaml + volumes: ssh: preparams: + grafana_storage: diff --git a/contrib/localnet/grafana/dashboards/log_browser.json b/contrib/localnet/grafana/dashboards/log_browser.json new file mode 100644 index 0000000000..27851fe69d --- /dev/null +++ b/contrib/localnet/grafana/dashboards/log_browser.json @@ -0,0 +1,212 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Easily browse logs for containers and filter by time", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 5, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "zetaclient_pending_txs_total", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Pending TXs total", + "type": "timeseries" + }, + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 6 + }, + "id": 2, + "options": { + "dedupStrategy": "signature", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "9.1.7", + "repeat": "log_containers", + "repeatDirection": "v", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "editorMode": "builder", + "expr": "{container=\"$log_containers\"}", + "queryType": "range", + "refId": "A" + } + ], + "title": "${log_containers}", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": [ + "zetaclient0", + "zetacore0" + ], + "value": [ + "zetaclient0", + "zetacore0" + ] + }, + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "definition": "label_values(container)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "log_containers", + "options": [], + "query": "label_values(container)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Log Browser", + "uid": "QD_fGXuSk", + "version": 6, + "weekStart": "" + } \ No newline at end of file diff --git a/contrib/localnet/grafana/datasource.yaml b/contrib/localnet/grafana/datasource.yaml index 59cd333a94..3c0d5e3680 100644 --- a/contrib/localnet/grafana/datasource.yaml +++ b/contrib/localnet/grafana/datasource.yaml @@ -13,4 +13,8 @@ datasources: prometheusVersion: 2.48.1 cacheLevel: 'High' disableRecordingRules: false - incrementalQueryOverlapWindow: 10m \ No newline at end of file + incrementalQueryOverlapWindow: 10m + - name: Loki + type: loki + access: proxy + url: http://loki:3100 \ No newline at end of file diff --git a/contrib/localnet/grafana/get-tss-address.sh b/contrib/localnet/grafana/get-tss-address.sh deleted file mode 100755 index eae4b031af..0000000000 --- a/contrib/localnet/grafana/get-tss-address.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -/usr/sbin/sshd - -#retrieve value of ETH TSS Address from localnet -ethTSS_address=$(curl 'http://localhost:1317/zeta-chain/observer/get_tss_address' | jq -r '.eth') - -#write value of ETH TSS Address to addresses.txt file -printf "ethTSS:$ethTSS_address\n" > addresses.txt \ No newline at end of file diff --git a/contrib/localnet/promtail/config.yaml b/contrib/localnet/promtail/config.yaml new file mode 100644 index 0000000000..82a6922caf --- /dev/null +++ b/contrib/localnet/promtail/config.yaml @@ -0,0 +1,19 @@ +server: + http_listen_port: 9080 + grpc_listen_port: 0 + +positions: + filename: /tmp/positions.yaml + +clients: + - url: http://loki:3100/loki/api/v1/push + +scrape_configs: + - job_name: flog_scrape + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + relabel_configs: + - source_labels: ['__meta_docker_container_name'] + regex: '/(.*)' + target_label: 'container' From a4073fa93499f5517d7a02380f3936b3625ec448 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 30 Jul 2024 23:53:07 -0700 Subject: [PATCH 3/5] fix(e2e): update performance test parameters and bump go-tss (#2563) * fix(e2e): increase performance test timeouts * bump go-tss --- Makefile | 2 +- cmd/zetae2e/local/performance.go | 7 +++++++ cmd/zetae2e/local/test_runner.go | 4 ++++ go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a739e22460..5788975d79 100644 --- a/Makefile +++ b/Makefile @@ -249,7 +249,7 @@ start-e2e-admin-test: zetanode start-e2e-performance-test: zetanode @echo "--> Starting e2e performance test" export E2E_ARGS="--test-performance" && \ - cd contrib/localnet/ && $(DOCKER_COMPOSE) -f docker-compose.yml up -d + cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile stress -f docker-compose.yml up -d start-e2e-import-mainnet-test: zetanode @echo "--> Starting e2e import-data test" diff --git a/cmd/zetae2e/local/performance.go b/cmd/zetae2e/local/performance.go index 4039084550..d6ad06b29e 100644 --- a/cmd/zetae2e/local/performance.go +++ b/cmd/zetae2e/local/performance.go @@ -75,6 +75,13 @@ func ethereumWithdrawPerformanceRoutine( return err } + if r.ReceiptTimeout == 0 { + r.ReceiptTimeout = 15 * time.Minute + } + if r.CctxTimeout == 0 { + r.CctxTimeout = 15 * time.Minute + } + r.Logger.Print("🏃 starting Ethereum withdraw performance tests") startTime := time.Now() diff --git a/cmd/zetae2e/local/test_runner.go b/cmd/zetae2e/local/test_runner.go index 198260c05c..14a6ba28fe 100644 --- a/cmd/zetae2e/local/test_runner.go +++ b/cmd/zetae2e/local/test_runner.go @@ -30,6 +30,10 @@ func initTestRunner( return nil, err } + // copy timeouts from deployer runner + testRunner.CctxTimeout = deployerRunner.ReceiptTimeout + testRunner.ReceiptTimeout = deployerRunner.ReceiptTimeout + // copy contracts from deployer runner if err := testRunner.CopyAddressesFrom(deployerRunner); err != nil { return nil, err diff --git a/go.mod b/go.mod index 8547f9a94b..36ed78c753 100644 --- a/go.mod +++ b/go.mod @@ -364,4 +364,4 @@ replace github.com/evmos/ethermint => github.com/zeta-chain/ethermint v0.0.0-202 replace github.com/libp2p/go-libp2p => github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4 -replace gitlab.com/thorchain/tss/go-tss => github.com/zeta-chain/go-tss v0.0.0-20240718213003-31767e0c90ba +replace gitlab.com/thorchain/tss/go-tss => github.com/zeta-chain/go-tss v0.0.0-20240729195411-9f5ae8189449 diff --git a/go.sum b/go.sum index cae8e37049..2e12e9da23 100644 --- a/go.sum +++ b/go.sum @@ -1738,8 +1738,8 @@ github.com/zeta-chain/ethermint v0.0.0-20240531172701-61d040058c94 h1:M54ljayJvy github.com/zeta-chain/ethermint v0.0.0-20240531172701-61d040058c94/go.mod h1:s1zA6OpXv3Tb5I0M6M6j5fo/AssaZL/pgkc7G0W2kN8= github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4 h1:FmO3HfVdZ7LzxBUfg6sVzV7ilKElQU2DZm8PxJ7KcYI= github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4/go.mod h1:TBv5NY/CqWYIfUstXO1fDWrt4bDoqgCw79yihqBspg8= -github.com/zeta-chain/go-tss v0.0.0-20240718213003-31767e0c90ba h1:7Qcc2uQq2Tp1OSRMiJA7GRZr+PV6Le0a1TGw3q/8Vho= -github.com/zeta-chain/go-tss v0.0.0-20240718213003-31767e0c90ba/go.mod h1:LN1IBRN8xQkKgdgLhl5BDGZyPm70QOTbVLejdS2FVpo= +github.com/zeta-chain/go-tss v0.0.0-20240729195411-9f5ae8189449 h1:4U+4g2QQjbrmeLU1ZdCDU6CYsE5kbwMOKZ/PACR/vN8= +github.com/zeta-chain/go-tss v0.0.0-20240729195411-9f5ae8189449/go.mod h1:LN1IBRN8xQkKgdgLhl5BDGZyPm70QOTbVLejdS2FVpo= github.com/zeta-chain/keystone/keys v0.0.0-20231105174229-903bc9405da2 h1:gd2uE0X+ZbdFJ8DubxNqLbOVlCB12EgWdzSNRAR82tM= github.com/zeta-chain/keystone/keys v0.0.0-20231105174229-903bc9405da2/go.mod h1:x7Bkwbzt2W2lQfjOirnff0Dj+tykdbTG1FMJPVPZsvE= github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240418181724-c222fd3ae1f5 h1:ljM7xka3WZvth9k1uYxrG3/FKQQTkR96FZlIjUKOoYw= From 746d63809707e2183dc4c89fe282908ca555a681 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 30 Jul 2024 23:54:10 -0700 Subject: [PATCH 4/5] fix(ci): remove job concurrency (#2595) --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8b5869c15..b5cd6a42ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,6 @@ jobs: build-and-test: runs-on: ubuntu-20.04 timeout-minutes: 15 - concurrency: - group: "build-and-test" steps: - uses: actions/checkout@v4 From 34f09bf19e29ca463142e06d3770a7ef5ccf6333 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Wed, 31 Jul 2024 09:04:11 -0700 Subject: [PATCH 5/5] ci: run on PRs to all base branches --- .github/workflows/build.yml | 6 ------ .github/workflows/e2e.yml | 2 -- .github/workflows/sast-linters.yml | 3 --- 3 files changed, 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5cd6a42ca..5e360f442a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,12 +7,6 @@ on: - release/* merge_group: pull_request: - branches: - - "*" - types: - - synchronize - - opened - - reopened concurrency: group: pr-testing-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5ac6412bac..0056022622 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -6,8 +6,6 @@ on: - develop - release/* pull_request: - branches: - - "*" merge_group: schedule: # run at 6AM UTC Daily diff --git a/.github/workflows/sast-linters.yml b/.github/workflows/sast-linters.yml index 270e9cffc6..26c8fb895d 100644 --- a/.github/workflows/sast-linters.yml +++ b/.github/workflows/sast-linters.yml @@ -8,9 +8,6 @@ on: - "*" merge_group: pull_request: - types: - - opened - - synchronize concurrency: group: linters-${{ github.head_ref || github.run_id }}